Skip to content

Commit 1bac109

Browse files
author
Hugo Osvaldo Barrera
committed
Don't crash if no arguments are provided via CLI
1 parent f14c512 commit 1bac109

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

barcode/pybarcode.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def main():
111111
create_parser.set_defaults(type='svg', compress=False, func=create_barcode,
112112
barcode='code39', text=None)
113113
args = parser.parse_args()
114-
args.func(args, parser)
114+
try:
115+
args.func(args, parser)
116+
except AttributeError:
117+
print("Use --help to see help")
115118

116119

117120
if __name__ == '__main__':

0 commit comments

Comments
 (0)