Skip to content

Commit

Permalink
dcg: print short help when called without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
pnxs committed Dec 12, 2020
1 parent c9829f8 commit 7fadf27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/dcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def processFile(self, fileName):


if __name__ == "__main__":
usage = "usage: %prog [options] dots-files"
usage = "usage: %prog -C <config-file> [-D] [-T <template-path>] [-o <output-path>] [-v] [-M] <dots-files>"
parser = OptionParser(usage=usage)
parser.add_option("-C", "--config", dest="configFile")
parser.add_option("-D", "--define", dest="define", action="append")
Expand Down Expand Up @@ -279,6 +279,9 @@ def processFile(self, fileName):
dcg.defines = defines
dcg.outputPath = options.outputPath

if configFile is None or len(configFile) == 0:
parser.error("No config file given.")

dcg.loadConfig(configFile)

if dcg.verbose:
Expand Down

0 comments on commit 7fadf27

Please sign in to comment.