Skip to content

Commit

Permalink
Add remainder_kv example
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Sep 1, 2023
1 parent b415021 commit 0a5f852
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions example/remainder_kv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from jarvis_util.util.argparse import ArgParse


class MyArgParse(ArgParse):
def define_options(self):
self.add_menu(keep_remainder=True,
remainder_as_kv=True)
self.add_args([
{
'name': 'hi',
'msg': 'hello',
'type': str,
'default': None
}
])

def main_menu(self):
print(self.kwargs['hi'])
print(self.remainder_kv)


args = MyArgParse()
args.process_args()

0 comments on commit 0a5f852

Please sign in to comment.