taskyaGTD - Yet Another Getting Things Done. - Tasks: task #7119, Provide way to run commands...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #7119: Provide way to run commands non-interactively

Submitted by:  Max Vozeler <mvz>
Submitted on:  Tue 20 Jul 2010 08:18:39 AM UTC  
 
Should Start On: Fri 23 Jul 2010 12:00:00 AM UTCShould be Finished on: Sat 24 Jul 2010 12:00:00 AM UTC
Category: NonePriority: 5 - Normal
Status: Ready For TestPrivacy: Public
Percent Complete: 100%Assigned to: MiKaël NAVARRO <klnavarro>
Open/Closed: ClosedEffort: 1.00

(Jump to the original submission Jump to the original submission)

Sat 21 Aug 2010 08:14:50 AM UTC, comment #6:

Your shell script has been added in yaGTD 0.3.4 release :)

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Fri 30 Jul 2010 04:38:09 PM UTC, comment #5:

Max Vozeler <max@hinterhof.net>
sender-time Sent at 16:44 (GMT+02:00). Current time there: 6:33 PM.
to MiKael NAVARRO <klnavarro@gmail.com>
date Fri, Jul 30, 2010 at 16:44

Hi MiKael,

On Wed, Jul 28, 2010 at 11:35:36AM +0200, MiKael NAVARRO wrote:

> In fact I have chosen this syntax (use options instead of passing
> arguments) because is more easy to control and in the futur I plan to
> allow multiple commands to be launched and executed in a given order
> (ex ./yagtd-cli.py --list "" --add "Tasktext @context p:project"
> --order "5 project").


Makes sense!

> > Perhaps some of that typing-friendlyness could be put into
> > yagtd-cli syntax directly.
>
> I don't wish integrate some of that typing-friendlyness
> because this imply a maintenance of these commands into yagtd-cli.py,
> while today, with my mechanism, options are created automatically
> (as soon as it is added in yagtd.py).


Understood. These are sound arguments for choosing the option-
with-arguments syntax over the more free-form syntax.

> > But then I'm also very happy using
> > something like the above, so consider me one happy user. :)
>
> I will be happy too, if you accept to publish your shell script into
> my yaGTD package ?
> It could help somebody in the same situation...


Yes, of course. :)

The shell function I sent is not robust, though. If you are
considering to include it, let me send you a better version in
a small shell script. (see attached)

Thanks and best regards,

Max

(file #9640)

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Fri 30 Jul 2010 04:32:19 PM UTC, comment #4:

MiKael NAVARRO <klnavarro@gmail.com>
sender-time Sent at 11:35 (GMT+02:00). Current time there: 6:31 PM.
to Max Vozeler <max@hinterhof.net>
date Wed, Jul 28, 2010 at 11:35

Hi Max,

> yagtd-cli.py has been working perfectly for me over the last
> two days, thank you very much!
>
> The syntax is working fine for me. Although I must admit that
> I find it a bit difficult to remember having to apply correct
> quoting of the command arguments.


In fact I have chosen this syntax (use options instead of passing
arguments) because is more easy to control and in the futur I plan to
allow multiple commands to be launched and executed in a given order
(ex ./yagtd-cli.py --list "" --add "Tasktext @context p:project"
--order "5 project").

> That's why I've been using a small shell function which IMHO
> gives a typing-friendlier interface:
>
> y() {
> cmd=$1; shift; args="$*"
> yagtd-cli.py --${cmd} "$args" ~/todo.txt
> }
>
> This allows me to say:
>
> $ y add Tasktext @context p:project
> $ y listall
>
> Perhaps some of that typing-friendlyness could be put into
> yagtd-cli syntax directly.


I don't wish integrate some of that typing-friendlyness
because this imply a maintenance of these commands into yagtd-cli.py,
while today, with my mechanism, options are created automatically
(as soon as it is added in yagtd.py).

> But then I'm also very happy using
> something like the above, so consider me one happy user. :)


I will be happy too, if you accept to publish your shell script into
my yaGTD package ?
It could help somebody in the same situation...

> Also I like the --help output a lot.

Thks

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Fri 30 Jul 2010 04:30:33 PM UTC, comment #3:

Max Vozeler <max@hinterhof.net>
sender-time Sent at 15:38 (GMT+02:00). Current time there: 6:29 PM.

Hello MiKaël,

gna.org won't allow me to add comments to the task, it says
my user account is not authorized. Something to change maybe?

I would add more comments, but I will just send them in this
email instead, maybe we can later paste the conversation into
the gna.org task ticket.

On Sat, Jul 24, 2010 at 06:48:28PM +0200, MiKaël NAVARRO wrote:

> I have written a wrapper script 'yagtd-cli.py' allowing to run commands
> non-interactively (see help: $ yagtd-cli.py --help).
>
> This wrapper dynamically inspect main GTD class:
> - to find all implemented commands (with associated docstring),
> - and create an option to yagtd-cli.py script.
>
> But, the syntax is somewhat different:
> $ yagtd-cli.py --list "" todo.txt
> $ yagtd-cli.py --add "Text @work p:customer2" todo.txt
> $ yagtd-cli.py --order "5" todo.txt
>
> P.S.:
> - All commands option need a string argument or an empty string "";
> - An auto-save is done automatically before exiting the script;
> - Multiple commands can be submitted, but the order is not preserved (yet).
>
> Could you test this script (attached to this task #7119)?
> Thanks in advance.


yagtd-cli.py has been working perfectly for me over the last
two days, thank you very much!

The syntax is working fine for me. Although I must admit that
I find it a bit difficult to remember having to apply correct
quoting of the command arguments.

That's why I've been using a small shell function which IMHO
gives a typing-friendlier interface:

y() {
cmd=$1; shift; args="$*"
yagtd-cli.py --${cmd} "$args" ~/todo.txt
}

This allows me to say:

$ y add Tasktext @context p:project
$ y listall

Perhaps some of that typing-friendlyness could be put into
yagtd-cli syntax directly. But then I'm also very happy using
something like the above, so consider me one happy user. :)

Also I like the --help output a lot.

Thanks and best regards,
Max

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Sat 24 Jul 2010 04:48:28 PM UTC, comment #2:

I have written a wrapper script 'yagtd-cli.py' allowing to run commands non-interactively (see help: $ yagtd-cli.py --help).

This wrapper dynamically inspect main GTD class:
- to find all implemented commands (with associated docstring),
- and create an option to yagtd-cli.py script.

But, the syntax is somewhat different:
$ yagtd-cli.py --list "" todo.txt
$ yagtd-cli.py --add "Text @work p:customer2" todo.txt
$ yagtd-cli.py --order "5" todo.txt

P.S.:
- All commands option need a string argument or an empty string "";
- An auto-save is done automatically before exiting the script;
- Multiple commands can be submitted, but the order is not preserved (yet).

Could you test this script (attached to this task #7119)?
Thanks in advance.

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Tue 20 Jul 2010 08:18:39 AM UTC, comment #1:

This item has been reassigned from the project yaGTD - Yet Another Getting Things Done. bugs tracker to your tracker.

The original report is still available at bugs #16268

Following are the information included in the original report:

[field #0] Item ID: 16268
[field #1] Group ID: 1970
[field #2] Open/Closed: Open
[field #3] Severity: 1 - Wish
[field #4] Privacy: Public
[field #8] : Unknown bugs Field Display Type
[field #9] Category: None
[field #10] Submitted by: mvz
[field #11] Assigned to: None
[field #12] Submitted on: Thursday 07/15/2010 at 16:30
[field #13] Summary: Provide way to run commands non-interactively
[field #14] Original Submission: I notice that I often start yagtd only to run a single command and then immediately exit from the yagtd shell.

Having some way to run the command non-interactively would make yagtd even more efficient and fun to use for me. :)

It would be great if yagtd could, for example, be passed a command on invocation like this:

$ yagtd todo.txt add Text @work p:customer2
Task #204 added

$ yagtd todo.txt listall
...
[field #16] Item Group: None
[field #17] Status: Works For Me
[field #18] Component Version: None
[field #19] Operating System: None
[field #20] Reproducibility: None
[field #21] Size (loc): None
[field #22] Fixed Release: None
[field #23] Planned Release: None
[field #24] Effort: 0.00
[field #28] Priority: 5 - Normal
[field #31] Percent Complete: 0%
[field #33] Release: None
[field #58] Custom Select Box #1: None
[field #59] Custom Select Box #2: None
[field #60] Custom Select Box #3: None
[field #61] Custom Select Box #4: None
[field #62] Custom Select Box #5: None
[field #63] Custom Select Box #6: None
[field #64] Custom Select Box #7: None
[field #65] Custom Select Box #8: None
[field #66] Custom Select Box #9: None
[field #67] Custom Select Box #10: None

MiKaël NAVARRO <klnavarro>
Project AdministratorIn charge of this item.
Tue 20 Jul 2010 08:18:39 AM UTC, original submission:

I notice that I often start yagtd only to run a single command and then immediately exit from the yagtd shell.

Having some way to run the command non-interactively would make yagtd even more efficient and fun to use for me. :)

It would be great if yagtd could, for example, be passed a command on invocation like this:

$ yagtd todo.txt add Text @work p:customer2
Task #204 added

$ yagtd todo.txt listall
...

Max Vozeler <mvz>

 

Attached Files
file #9640:  y added by klnavarro (113B - application/octet-stream - Small shell script allowing more free-form syntax.)
file #9556:  yagtd-cli.py added by klnavarro (6kB - text/x-python - Command Line Interface for yaGTD.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by klnavarro (Updated the item)
  • -unavailable- added by mvz (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 15 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Aug 2010 08:14:50 AM UTCklnavarroOpen/ClosedOpen=>Closed
    Fri 30 Jul 2010 04:38:09 PM UTCklnavarroAttached File-=>Added y, #9640
    Sat 24 Jul 2010 04:28:43 PM UTCklnavarroAttached File-=>Added yagtd-cli.py, #9556
    Sat 24 Jul 2010 04:28:08 PM UTCklnavarroAttached File#9555=>Removed
    Sat 24 Jul 2010 04:27:56 PM UTCklnavarroAttached File-=>Added yagtd-cli.py, #9555
      Should Start OnSat 24 Jul 2010 12:00:00 AM UTC=>Fri 23 Jul 2010 12:00:00 AM UTC
      StatusIn Progress=>Ready For Test
      Percent Complete90%=>100%
      Assigned toNone=>klnavarro
      Effort0.00=>1.00
    Sat 24 Jul 2010 08:05:45 AM UTCklnavarroPercent Complete0%=>90%
    Sat 24 Jul 2010 08:05:23 AM UTCklnavarroShould Start On-=>Sat 24 Jul 2010 12:00:00 AM UTC
      Should be Finished on-=>Sat 24 Jul 2010 12:00:00 AM UTC
      StatusNone=>In Progress
    Tue 20 Jul 2010 08:18:39 AM UTCklnavarroReassign itemyaGTD - Yet Another Getting Things Done., bug #16268=>yaGTD - Yet Another Getting Things Done., task #7119
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup