mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 12:31:06 +01:00
continued refactoring, added more tests, better error handling
This commit is contained in:
@@ -40,16 +40,18 @@ func contains(s []int, e int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func PrepareColumns() {
|
||||
func PrepareColumns() error {
|
||||
if len(Columns) > 0 {
|
||||
for _, use := range strings.Split(Columns, ",") {
|
||||
usenum, err := strconv.Atoi(use)
|
||||
if err != nil {
|
||||
die(err)
|
||||
msg := fmt.Sprintf("Could not parse columns list %s: %v", Columns, err)
|
||||
return errors.New(msg)
|
||||
}
|
||||
UseColumns = append(UseColumns, usenum)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func PrepareModeFlags() error {
|
||||
|
||||
Reference in New Issue
Block a user