salimoha / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

Add Input/Output files capabilities #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Use and argument to indicate and input or output file as input into the command 
line.  

For instance, if you want to add a collection of contacts, you could have a 
file with a line for each contact, using -i (filename) it would read in each 
line and process accordingly.

After executing, each line from the file would result in a new record (contact, 
calendar, etc) entry based on the given line input.

It might be necessary to also include a delimiter options so you could indicate 
a comma, a pipe, a colon, etc for separation of each record or field within the 
file.  This would be dependent upon the specific option.

Original issue reported on code.google.com by ebre...@gmail.com on 22 Jun 2010 at 2:29

GoogleCodeExporter commented 9 years ago
I would like to see the output option in docs. Perhaps

google docs get --title "foo" -

To output the file to stdout. I currently use a password manager which uses an 
encrypted text file as it's db. Currently it's stored locally, but it would be 
nice to be able to store this file on google docs and read it directly from 
there so I wouldn't have to manually synchronize it between multiple computers.

Original comment by tjmcg...@gmail.com on 22 Jun 2010 at 3:04

GoogleCodeExporter commented 9 years ago
I guess it depends on how true GoogleCL wants to stick to the cli nature.  For 
example, using input/output redirection may be a better design choice than 
adding options. 

Just a thought; I don't know what the right answer is.

Original comment by ericvw on 25 Jun 2010 at 2:17

GoogleCodeExporter commented 9 years ago
This item is probably an enhancement not a Defect type.  Not sure how to change 
that.

My thoughts on this were based on the tar or cat commands but I'm sure other 
similar command line tools have similar usages.

With tar you can indicate "-" as the "filename" to represent standard 
input/output when specifying a file (-f) option or equivalent option.  

For example:
 tar cvf - foldername/* | ( cd ../anotherDirector; | tar xvf -)

The first tar instance creates an archive and outputs it to standard out.
The output of one is piped (|) to the second command.
The second tar takes (after changing directories) as standard input the 
standard output from the first.

With cat:

(1) cat - >> fileName

Which leaves off input filename argument but include "-" as filename to 
indicate usage of standard input, then redirects the standard output to an 
output file

(2) cat fileName 
Which uses "fileName" contents redirects it to standard outputs.

Or maybe better approach is usage of a getopt() type operation.

Original comment by ebre...@gmail.com on 25 Jun 2010 at 2:33

GoogleCodeExporter commented 9 years ago
ebresie - New tickets default to Defect.  Only owners of the project are 
allowed to add/change different Issue types.

Original comment by ericvw on 25 Jun 2010 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by tom.h.mi...@gmail.com on 23 Jul 2010 at 10:53