From 8162fc6f897be24db36a23bbea43d30456348cc6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 15 May 2009 12:11:56 +0000 Subject: [PATCH] make hours just like hledger, aside from the choice of file --- Options.hs | 13 ++++++------- README | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Options.hs b/Options.hs index 6f7e39f3c..ef1a8fc31 100644 --- a/Options.hs +++ b/Options.hs @@ -29,8 +29,8 @@ usagehdr = ( " hours [OPTIONS] [COMMAND [PATTERNS]]\n" ++ " hledger convert CSVFILE ACCOUNTNAME RULESFILE\n" ++ "\n" ++ - "hledger uses your ~/.ledger or $LEDGER file (or another specified with -f).\n" ++ - "hours uses your ~/.timelog or $TIMELOG, and --period today as default.\n" ++ + "hledger uses your ~/.ledger or $LEDGER file (or another specified with -f),\n" ++ + "while hours uses your ~/.timelog or $TIMELOG file.\n" ++ "\n" ++ "COMMAND is one of (may be abbreviated):\n" ++ " add - prompt for new transactions and add them to the ledger\n" ++ @@ -126,15 +126,14 @@ optValuesForConstructors fs opts = concatMap get opts -- | Parse the command-line arguments into options, command name, and -- command arguments. Any dates in the options are converted to explicit --- YYYY/MM/DD format based on the current time. If the program was invoked --- as \"hours\", the -f $TIMELOG -p today options are assumed as a default. +-- YYYY/MM/DD format based on the current time. parseArguments :: IO ([Opt], String, [String]) parseArguments = do args <- liftM (map decodeString) getArgs let (os,as,es) = getOpt Permute options args - istimequery <- usingTimeProgramName - let os' = if istimequery then (Period "today"):os else os - os'' <- fixOptDates os' +-- istimequery <- usingTimeProgramName +-- let os' = if istimequery then (Period "today"):os else os + os'' <- fixOptDates os case (as,es) of (cmd:args,[]) -> return (os'',cmd,args) ([],[]) -> return (os'',"",[]) diff --git a/README b/README index 1dc7df8fe..c43df6006 100644 --- a/README +++ b/README @@ -62,8 +62,7 @@ Time reporting hledger will also read timeclock.el-format timelog entries. As a convenience, if you invoke hledger via a link or copy named "hours", it -uses your timelog file (~/.timelog or $TIMELOG) and --period today as -defaults.:: +uses your timelog file (~/.timelog or $TIMELOG) by default.:: hours [OPTIONS] [COMMAND [PATTERNS]] @@ -77,10 +76,10 @@ The clockin description is an account name. Here are some queries to try:: ln -s `which hledger` ~/bin/hours # add the "hours" symlink in your path export TIMELOG=sample.timelog hours # time logged today, if any - hours 'last month' # last month - hours thisyear # the space is optional - hours 'from 1/15' register proj # project sessions since last jan 15 - hours 'weekly this year' reg --depth 1 # weekly time summary + hours -p 'last month' # last month + hours -p thisyear # the space is optional + hours -p 'from 1/15' register proj # project sessions since last jan 15 + hours -p 'weekly this year' reg --depth 1 # weekly time summary Features --------