Re: Printing to stdout

2023-06-10 Thread John Wiegley
> "BW" == Bob Wilson  writes:

BW> --no-pager works. Terminology in hand, the guide suggested looking at the
BW> LEDGER_PAGER environment variable, which is unset on my platform.

BW> I installed via homebrew (I'm on macos 13.4). Perhaps some detail on how
BW> they compiled ledger is relevant?

It looks like this may have broken in commit
21280a9da3ca6ed70a10f95e1ef0717d5f65ee99:

  commit 21280a9da3ca6ed70a10f95e1ef0717d5f65ee99
  Author: Martin Michlmayr 
  Date:   Tue Jun 16 13:17:53 2020 +0800
  
  Use PAGER when environment variable is set
  
  The code looked for "less" if $PAGER is not set, but it didn't
  actually use $PAGER when it it defined.
  
  Fixes #1674

Nothing else since that earlier release date has changed the PAGER logic.

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2legrw1no.fsf%40newartisans.com.


Re: Reducing repetition/duplication of amount value in entries

2023-06-10 Thread John Wiegley
> "VA" == Viraj Alankar  writes:

VA> Something I was a bit confused about. If I change the automated
VA> transaction to:

VA> = "Liabilities:Apple Card" and has_tag("cashback")

This is a bug in the query parser, which you can see by running:

  ledger query '"Liabilities:Apple Card" and has_tag("cashback")'

It seems that %cashback also has a bug, but it’s harmless and so you don’t
notice the problem.

The query parser needs an overhaul.

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2pm63w1s0.fsf%40newartisans.com.


Re: Printing to stdout

2023-06-10 Thread Bob Wilson
--no-pager works. Terminology in hand, the guide suggested looking at the 
LEDGER_PAGER environment variable, which is unset on my platform.

I installed via homebrew (I'm on macos 13.4). Perhaps some detail on how 
they compiled ledger is relevant?

On Friday, June 9, 2023 at 11:36:04 PM UTC-7 John Wiegley wrote:

> > "BW" == Bob Wilson  writes:
>
> BW> Previously, running a command like `ledger -f ledger.dat balance ^ 
> Assets`
> BW> would print results directly to the screen and return me to the prompt,
> BW> but now that same command prints results to some kind of temporary 
> screen
> BW> that disappears when I hit `q`. It's like the difference between `cat` 
> and
> BW> `less`. Sorry I don't know the right terminology!
>
> Can you try with the --no-pager option? I’m not sure why the default 
> behavior
> would have changed, though…
>
> John
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/162672b7-182b-48a6-b9fa-3471487b4daen%40googlegroups.com.


Re: Reducing repetition/duplication of amount value in entries

2023-06-10 Thread Viraj Alankar
Sure, I'll make a pull request.

Something I was a bit confused about. If I change the automated transaction
to:

= "Liabilities:Apple Card" and has_tag("cashback")

It doesn't seem to work. There is no error, it just doesn't apply the
transaction. Do you happen to know the right way to use has_tag() here?

Thanks,

Viraj.





On Fri, Jun 9, 2023 at 9:14 PM John Wiegley  wrote:

> > "VA" == Viraj Alankar  writes:
>
> VA> I found one way that I think should work:
> VA> = "Liabilities:Apple Card" and %cashback
> VA> Assets:Apple Cash   (-tag("cashback"))
> VA> Income:Credit Card Rewards   (tag("cashback"))
>
> VA> 2023/06/06 McDonalds
> VA> ; cashback:: 0.02
> VA> Expenses:Food:Restaurants   $23.98
> VA> Liabilities:Apple Card
> VA> 2023/06/07 Transfer
> VA> Liabilities:Apple Card  $23.98
> VA> Assets:Some bank
>
> VA> Mainly found by searching bugs. The manual would really benefit with
> some
> VA> more realistic examples in the Automated Transactions section.
>
> Interesting example! Please feel free to submit it as an addition to the
> docs,
> if you’d be willing.
>
> John
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAM502dPODwCWuNWjM9bx0xt4UU2_pdp5BkdCxDitsDbmoULyUQ%40mail.gmail.com.


Re: Printing to stdout

2023-06-10 Thread John Wiegley
> "BW" == Bob Wilson  writes:

BW> Previously, running a command like `ledger -f ledger.dat balance ^ Assets`
BW> would print results directly to the screen and return me to the prompt,
BW> but now that same command prints results to some kind of temporary screen
BW> that disappears when I hit `q`. It's like the difference between `cat` and
BW> `less`. Sorry I don't know the right terminology!

Can you try with the --no-pager option? I’m not sure why the default behavior
would have changed, though…

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2ttvfvn7a.fsf%40newartisans.com.