diff --git a/hledger/Hledger/Cli/CliOptions.hs b/hledger/Hledger/Cli/CliOptions.hs index 42d797b56..501673ee4 100644 --- a/hledger/Hledger/Cli/CliOptions.hs +++ b/hledger/Hledger/Cli/CliOptions.hs @@ -154,7 +154,14 @@ Right binaryinfo = parseHledgerVersion prognameandversion -- | Common input-related flags: --file, --rules, --conf, --alias... inputflags :: [Flag RawOpts] inputflags = [ - flagReq ["file","f"] (\s opts -> Right $ setopt "file" s opts) "[FMT:]FILE" "Read data from FILE, or from stdin if FILE is -, inferring format from extension or a FMT: prefix. Can be specified more than once. If not specified, reads from $LEDGER_FILE or $HOME/.hledger.journal." + flagReq ["file","f"] (\s opts -> Right $ setopt "file" s opts) "[FMT:]FILE" $ unwords [ + "Use this as the journal file (- means stdin)." + ,"If not specified, $LEDGER_FILE or ~/.hledger.journal will be used." + ,"If specified more than once, the files will be read in order." + ,"Each file's format (journal, csv, timeclock, timedot, rules..) is inferred from the file extension or a FMT: prefix." + ,"Some commands (add, import) write to the (first) file," + ,"and expect it to be in journal format." + ] ,flagReq ["rules"] (\s opts -> Right $ setopt "rules" s opts) "RULESFILE" "Use rules defined in this rules file for converting subsequent CSV/SSV/TSV files. If not specified, uses FILE.csv.rules for each FILE.csv." -- see also hiddenflags ,flagReq ["alias"] (\s opts -> Right $ setopt "alias" s opts) "A=B|/RGX/=RPL" "transform account names from A to B, or by replacing regular expression matches" diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Commands/Add.hs index 3c53051c6..4fb2861f5 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Commands/Add.hs @@ -54,7 +54,7 @@ addmode = hledgerCommandMode [flagNone ["no-new-accounts"] (setboolopt "no-new-accounts") "don't allow creating new accounts"] [generalflagsgroup2] [] - ([], Just $ argsFlag "[DATE [DESCRIPTION [ACCOUNT1 [AMOUNT1 [ACCOUNT2 [ETC...]]]]]]") + ([], Just $ argsFlag "[-f JOURNALFILE] [DATE [DESCRIPTION [ACCOUNT1 [ETC..]]]]]") -- | State used while entering transactions. data EntryState = EntryState { diff --git a/hledger/Hledger/Cli/Commands/Add.md b/hledger/Hledger/Cli/Commands/Add.md index f24fbbe62..24c20d7a9 100644 --- a/hledger/Hledger/Cli/Commands/Add.md +++ b/hledger/Hledger/Cli/Commands/Add.md @@ -1,6 +1,6 @@ ## add -Add new transactions to a journal file, with interactive prompting in the console. +Add new transactions to a journal file, with interactive prompting. ```flags Flags: diff --git a/hledger/Hledger/Cli/Commands/Import.hs b/hledger/Hledger/Cli/Commands/Import.hs index 18b46f0e2..0a4368a48 100644 --- a/hledger/Hledger/Cli/Commands/Import.hs +++ b/hledger/Hledger/Cli/Commands/Import.hs @@ -27,7 +27,7 @@ importmode = hledgerCommandMode ] cligeneralflagsgroups1 hiddenflags - ([], Just $ argsFlag "FILE [...]") + ([], Just $ argsFlag "[-f JOURNALFILE] DATAFILES...") importcmd opts@CliOpts{rawopts_=rawopts,inputopts_=iopts} j = do -- XXX could be helpful to show the last-seen date, and number of old transactions, too @@ -53,7 +53,7 @@ importcmd opts@CliOpts{rawopts_=rawopts,inputopts_=iopts} j = do } case inputfiles of - [] -> error' "please provide one or more input files as arguments" -- PARTIAL: + [] -> error' "please provide one or more data files as arguments" -- PARTIAL: fs -> do enewjandlatestdatesforfiles <- runExceptT $ readJournalFilesAndLatestDates iopts' fs case enewjandlatestdatesforfiles of