help-recutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-recutils] Suggestions on recutils CLI


From: Jose E. Marchesi
Subject: Re: [help-recutils] Suggestions on recutils CLI
Date: Tue, 05 May 2015 11:14:35 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hi Paul.

    Thank you for creating/maintaining recutils. I was searching for a
    human-readable plaintext database system for what felt like years...

You are welcome :)
    
    * $REC_FILE environment variable
    
    For those mostly working on a single database, having to repeat the
    filename can become tedious. ledger gets around this by allowing a
    LEDGER_FILE, which can be overridden with a flag and filename on the
    CLI. Alternately, the default database file could be set in a global
    ~/.rec config file.
    
    My current hackish workaround is a line in my profile:
        alias recsel="recsel -i ~/Documents/mydb.rec"

Sounds like a good idea, to make the utilities to react to the presence
of a file called 'Recfiles' in the current directory, and also a global
configuration file.

However, what would you put in the Recfiles file?

What I originally envisioned was to use directories to organize
recfiles.  The utilities could easily find the right file to open using
the type of the record referred in the command.  For example:

  $ echo $RECDIRS
  .:/my/database/:others/
  $ recsel -t Contact -p Name

The command above would search for a file named Contact.rec in any of
the directories in $RECDIRS...

    * Globally set --case-insensitive option
    
    I feel like case sensitively is the exception rather than the rule,
    hence the alias above sets the -i option whenever I call
    recsel. Another reason for a ~/.rec file?

Yes, definitely.  That should be configurable in a global configuration
file.  I would call the file ~/.recutilsrc tho.  "rec" is too general.
    
    * Long results could be piped through less
    
    Just a matter of convenience. I'm usually piping queries through less
    anyway, but it's usually a case of query then "oh bother" then query |
    less.

Another thing that could be configurable, a pager...
        
    * Tabulated output
    
    I managed to achieve tabulated output with the following...
    
        $ recsel FILE -t TYPE | rec2csv | column -t -s ',' | tr -d \"
    
    One problem with this method is that column does not honour quoted
    input, meaning that any commas within values are treated as new
    columns.
    
    Again just a matter of convenience, it would be great to tabulated
    output with just a single -T flag?

How would that compare to the existing -R?
    
    
    * RADICAL IDEA WARNING! recutils as a single modular command
    
    Similar to the way ledger or git works, you might have...
    
        $ rec select ...
        $ rec format ...
        $ rec insert ...
    
    ...with the command as the smallest unique substring, e.g. select
    and sel would be equivalent.

You are not the first suggesting that... but I really never saw the
point of using a multiplexer command like that.  What would be the
advantage of doing so?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]