-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DUCKARGS_COMMENT and DUCKARGS_PRINT environment variables
- Loading branch information
1 parent
bb84be0
commit 74898db
Showing
21 changed files
with
179 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckargs positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='A command-line program generated by duckargs', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('positional_arg1', help='a string') | ||
parser.add_argument('positional_arg2', help='a string') | ||
parser.add_argument('-i', '--int-val', default=4, type=int, help='an int value') | ||
parser.add_argument('-f', default=3.3, type=float, help='a float value') | ||
parser.add_argument('-f', '--file', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-F', '--otherfile', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-a', action='store_true', help='a flag') | ||
parser.add_argument('-b', action='store_true', help='b flag') | ||
parser.add_argument('-c', action='store_true', help='c flag') | ||
args = parser.parse_args() | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckargs positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='A command-line program generated by duckargs', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('positional_arg1', help='a string') | ||
parser.add_argument('positional_arg2', help='a string') | ||
parser.add_argument('-i', '--int-val', default=4, type=int, help='an int value') | ||
parser.add_argument('-f', default=3.3, type=float, help='a float value') | ||
parser.add_argument('-f', '--file', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-F', '--otherfile', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-a', action='store_true', help='a flag') | ||
parser.add_argument('-b', action='store_true', help='b flag') | ||
parser.add_argument('-c', action='store_true', help='c flag') | ||
args = parser.parse_args() | ||
|
||
print(args.positional_arg1) | ||
print(args.positional_arg2) | ||
print(args.int_val) | ||
print(args.f) | ||
print(args.file) | ||
print(args.otherfile) | ||
print(args.a) | ||
print(args.b) | ||
print(args.c) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckargs positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by duckargs, invoked with the following arguments: | ||
# positional_arg1 positional_arg2 -i --int-val 4 -f 3.3 -f --file FILE -F --otherfile FILE -a -b -c | ||
|
||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='A command-line program generated by duckargs', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('positional_arg1', help='a string') | ||
parser.add_argument('positional_arg2', help='a string') | ||
parser.add_argument('-i', '--int-val', default=4, type=int, help='an int value') | ||
parser.add_argument('-f', default=3.3, type=float, help='a float value') | ||
parser.add_argument('-f', '--file', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-F', '--otherfile', default=None, type=argparse.FileType(), help='a filename') | ||
parser.add_argument('-a', action='store_true', help='a flag') | ||
parser.add_argument('-b', action='store_true', help='b flag') | ||
parser.add_argument('-c', action='store_true', help='c flag') | ||
args = parser.parse_args() | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Generated by duckargs, invoked with the following arguments: | ||
# -a -b -c -d -e -f -g -h | ||
|
||
import argparse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Generated by duckargs, invoked with the following arguments: | ||
# -0x44 -f --fell -0x235 -x -0x8 | ||
|
||
import argparse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckargs -4 -f --ff -2 --blah -2343 -6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by duckargs, invoked with the following arguments: | ||
# -4 -f --ff -2 --blah -2343 -6 | ||
|
||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='A command-line program generated by duckargs', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('positional_arg0', type=int, help='an int value') | ||
parser.add_argument('-f', '--ff', default=-2, type=int, help='an int value') | ||
parser.add_argument('--blah', default=-2343, type=int, help='an int value') | ||
parser.add_argument('positional_arg1', type=int, help='an int value') | ||
args = parser.parse_args() | ||
|
||
print(args.positional_arg0) | ||
print(args.ff) | ||
print(args.blah) | ||
print(args.positional_arg1) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Generated by duckargs, invoked with the following arguments: | ||
# pos1 pos2 pos3 pos4 pos5 pos6 | ||
|
||
import argparse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters