Unkown flag error with base-url

85 views
Skip to first unread message

Kev Lau

unread,
Jul 29, 2015, 2:43:39 AM7/29/15
to hledger
Hi,
I keep getting uknown flag errors.

Could someone tell me what is wrong with my base url?
Or how do you do this?

hledger web --base-url=http://hledger.mydomain.net
hledger: Unknown flag: --base-url

Simon Michael

unread,
Jul 29, 2015, 3:17:08 PM7/29/15
to hle...@googlegroups.com
Hi Kev, welcome.

because hledger-web is an add-on command, there is a trick you need to know to use it's command-specific options: write them after --, like this:

hledger web -- --base-url=http://hledger.mydomain.net

Or you can invoke the hledger-web executable directly.

hledger-web --base-url=http://hledger.mydomain.net


Best
-Simon


--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kev Lau

unread,
Aug 6, 2015, 3:03:25 PM8/6/15
to hledger
Hi Simon,
Thank. Appreciate it.
Unfortunately because of the date syntax problem I dont think hledger will be suitable for me.
I use DD/MM/YYYY (as I live in Asia and have gotten used to this)
Unless there is a way to fix this.

Best Regards
Kevin

Martin Blais

unread,
Aug 6, 2015, 3:27:14 PM8/6/15
to hle...@googlegroups.com
Why don't you write a script to pre-process your input file.
Should take about 10-20 minutes.


--

Martin Blais

unread,
Aug 6, 2015, 4:04:05 PM8/6/15
to Martin Blais, hle...@googlegroups.com
Here, run your input file through this script:


#!/usr/bin/env python3                                                                                                              
"""Translate dates seen as the first word of any line to YYYY-MM-DD format."""

import datetime
import sys
import re

print(re.sub(
    '(\d\d-\d\d-\d\d\d\d)',
    lambda match: datetime.datetime.strptime(match.group(1), '%d-%m-%Y').strftime('%Y-%m-%d'),
    sys.stdin.read()))



Simon Michael

unread,
Aug 6, 2015, 5:24:02 PM8/6/15
to hle...@googlegroups.com
Oh yeah.. python exists! Thanks for this.

Just for fun I saved it as hledger-convertdates.py in my PATH, and made it executable (chmod +x hledger-convertdates.py), which means I can do (including on windows):

$ cat t.j
31-12-2014  hello
  ; a comment with-a-dateoid or 1-2-3
  a posting  1
  another

$ hledger convertdates < t.j | hledger -f - print

2014/12/31 hello
    ; a comment with-a-dateoid or 1-2-3
    a posting             1
    another              -1

Martin Blais

unread,
Aug 6, 2015, 5:34:10 PM8/6/15
to hle...@googlegroups.com
You could probably add two words of Haskell and integrate that into your parser ;-)

Simon Michael

unread,
Aug 6, 2015, 6:08:27 PM8/6/15
to hle...@googlegroups.com
I'll do it if we get the Details worked out here...
Reply all
Reply to author
Forward
0 new messages