Skip to content

Commit bb096b2

Browse files
authored
Merge pull request #1436 from myk002/myk_rename_cli
[gui/rename] actually read the argument from the commandline
2 parents c0ea8aa + 81d6b75 commit bb096b2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Template for new versions:
3333
## Fixes
3434
- `list-agreements`: fix date math when determining petition age
3535
- `gui/petitions`: fix date math when determining petition age
36+
- `gui/rename`: fix commandline processing when manually specifying target ids
3637

3738
## Misc Improvements
3839
- `fix/loyaltycascade`: now also breaks up brawls and other intra-fort conflicts that *look* like loyalty cascades

gui/rename.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,14 +1022,14 @@ local function main(args)
10221022
show_selector=true,
10231023
}
10241024
local positionals = argparse.processArgsGetopt(args, {
1025-
{ 'a', 'artifact', handler=function(optarg) opts.item_id = argparse.nonnegativeInt(optarg, 'artifact') end },
1026-
{ 'e', 'entity', handler=function(optarg) opts.entity_id = argparse.nonnegativeInt(optarg, 'entity') end },
1027-
{ 'f', 'histfig', handler=function(optarg) opts.histfig_id = argparse.nonnegativeInt(optarg, 'histfig') end },
1025+
{ 'a', 'artifact', hasArg=true, handler=function(optarg) opts.item_id = argparse.nonnegativeInt(optarg, 'artifact') end },
1026+
{ 'e', 'entity', hasArg=true, handler=function(optarg) opts.entity_id = argparse.nonnegativeInt(optarg, 'entity') end },
1027+
{ 'f', 'histfig', hasArg=true, handler=function(optarg) opts.histfig_id = argparse.nonnegativeInt(optarg, 'histfig') end },
10281028
{ 'h', 'help', handler = function() opts.help = true end },
1029-
{ 'l', 'location', handler=function(optarg) opts.location_id = argparse.nonnegativeInt(optarg, 'location') end },
1030-
{ 'q', 'squad', handler=function(optarg) opts.squad_id = argparse.nonnegativeInt(optarg, 'squad') end },
1031-
{ 's', 'site', handler=function(optarg) opts.site_id = argparse.nonnegativeInt(optarg, 'site') end },
1032-
{ 'u', 'unit', handler=function(optarg) opts.unit_id = argparse.nonnegativeInt(optarg, 'unit') end },
1029+
{ 'l', 'location', hasArg=true, handler=function(optarg) opts.location_id = argparse.nonnegativeInt(optarg, 'location') end },
1030+
{ 'q', 'squad', hasArg=true, handler=function(optarg) opts.squad_id = argparse.nonnegativeInt(optarg, 'squad') end },
1031+
{ 's', 'site', hasArg=true, handler=function(optarg) opts.site_id = argparse.nonnegativeInt(optarg, 'site') end },
1032+
{ 'u', 'unit', hasArg=true, handler=function(optarg) opts.unit_id = argparse.nonnegativeInt(optarg, 'unit') end },
10331033
{ 'w', 'world', handler=function() opts.world = true end },
10341034
{ '', 'no-target-selector', handler=function() opts.show_selector = false end },
10351035
})

0 commit comments

Comments
 (0)