Print usage if no arguments are provided

master
Dan Howe 7 years ago
parent cdcb962723
commit d27767d782

@ -122,9 +122,14 @@ def main():
'-n', metavar='LAYER_NAME', help='name of layer', default=None)
parser.add_argument(
'-l', action='store_true', help='show list of layers', default=False)
args = parser.parse_args()
# List usage if no arguments are provided
if len(sys.argv) == 1:
parser.print_help(sys.stderr)
sys.exit(1)
# Parse arguments
args = parser.parse_args()
dxf_name = args.dxf_name
layer_name = args.n
show_layers_only = args.l

Loading…
Cancel
Save