Skip to content

Commit e0fb1e3

Browse files
committed
feat: Allow --export to default to 'accounts.txt' when no argument is provided
This commit modifies the `argparse` setup for the `--export` (-e) argument. By adding `nargs='?'` and `const='accounts.txt'`, the argument can now be used as a flag without requiring a subsequent file path. If the `-e` flag is present without a value, `accounts.txt` will be used as the default input file for export operations. The `default='accounts.txt'` remains to handle cases where the `-e` flag is not provided at all.
1 parent 0a1545a commit e0fb1e3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cli/parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def setupArgParse():
5656

5757
# Adding agrument --export or -e
5858
parser.add_argument('-e', '--export',
59+
nargs='?',
5960
type=str,
61+
const='accounts.txt',
6062
default='accounts.txt',
6163
help='Specify the file to read account URIs from. Default is accounts.txt.')
6264

0 commit comments

Comments
 (0)