public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* how to chek for the number of options in an app
@  Ned
   ` Sean McMahon
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ned @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Hi all,
Is there a way to check, without counting by hand within the manual, how many options are there for a command such as ls, more, bash, etc?
If not, what's the shortest way of doing that through the man?

Many thanks in advance!
Ned

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to chek for the number of options in an app
   how to chek for the number of options in an app Ned
@  ` Sean McMahon
   ` Sina Bahram
   ` Sina Bahram
  2 siblings, 0 replies; 8+ messages in thread
From: Sean McMahon @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

commands usually start with - or -- so you could type command --help, where
command is the name of the command you are looking for, pipe that through grep
for the string '-' or '--' then pipe that through wc.  That might give you some
idea I'd look at the help or man pages first to see the syntax of how they show
you options so you can see how to grep for a sensible search string.  This
sounds like some kind of tricky way to answer some random exam question?
----- Original Message ----- 
From: "Ned" <ngranic@cox.net>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Sent: Wednesday, March 23, 2005 1:19 PM
Subject: how to chek for the number of options in an app


Hi all,
Is there a way to check, without counting by hand within the manual, how many
options are there for a command such as ls, more, bash, etc?
If not, what's the shortest way of doing that through the man?

Many thanks in advance!
Ned
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: how to chek for the number of options in an app
   how to chek for the number of options in an app Ned
   ` Sean McMahon
@  ` Sina Bahram
   ` Sina Bahram
  2 siblings, 0 replies; 8+ messages in thread
From: Sina Bahram @  UTC (permalink / raw)
  To: 'Speakup is a screen review system for Linux.'

Hmm, this isn't terribly accurate, but try this

ls --help | wc -l

Take care,
Sina

-----Original Message-----
From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
On Behalf Of Ned
Sent: Wednesday, March 23, 2005 3:19 PM
To: Speakup is a screen review system for Linux.
Subject: how to chek for the number of options in an app

Hi all,
Is there a way to check, without counting by hand within the manual, how
many options are there for a command such as ls, more, bash, etc?
If not, what's the shortest way of doing that through the man?

Many thanks in advance!
Ned
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: how to chek for the number of options in an app
   how to chek for the number of options in an app Ned
   ` Sean McMahon
   ` Sina Bahram
@  ` Sina Bahram
     ` Ned
     ` Lorenzo Taylor
  2 siblings, 2 replies; 8+ messages in thread
From: Sina Bahram @  UTC (permalink / raw)
  To: 'Speakup is a screen review system for Linux.'

Hi ned,

... To go back to what I said before, try playing with grep, so you could at
least set up a regular expression for only the lines that have commands on
them ...

Take care,
Sina 

-----Original Message-----
From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
On Behalf Of Ned
Sent: Wednesday, March 23, 2005 3:19 PM
To: Speakup is a screen review system for Linux.
Subject: how to chek for the number of options in an app

Hi all,
Is there a way to check, without counting by hand within the manual, how
many options are there for a command such as ls, more, bash, etc?
If not, what's the shortest way of doing that through the man?

Many thanks in advance!
Ned
_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to chek for the number of options in an app
   ` Sina Bahram
@    ` Ned
       ` Sina Bahram
     ` Lorenzo Taylor
  1 sibling, 1 reply; 8+ messages in thread
From: Ned @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Thanks Sina,

In your first post you said:
ls --help | wc -l
Wouldn't it only count the number of lines within the help file of the ls 
command?
The grep is a much better idea, I tried something like:
ls --help | grep -c '-'
and it returned 51 because it counted both '-' and '--', but don't know how 
to ... is there a logical or operator for situations like this?
I want to check for '-' or '--'
How to do that?

Many thanks!
Ned
----- Original Message ----- 
From: "Sina Bahram" <sbahram@nc.rr.com>
To: "'Speakup is a screen review system for Linux.'" 
<speakup@braille.uwo.ca>
Sent: Wednesday, March 23, 2005 11:28 PM
Subject: RE: how to chek for the number of options in an app


> Hi ned,
>
> ... To go back to what I said before, try playing with grep, so you could 
> at
> least set up a regular expression for only the lines that have commands on
> them ...
>
> Take care,
> Sina
>
> -----Original Message-----
> From: speakup-bounces@braille.uwo.ca 
> [mailto:speakup-bounces@braille.uwo.ca]
> On Behalf Of Ned
> Sent: Wednesday, March 23, 2005 3:19 PM
> To: Speakup is a screen review system for Linux.
> Subject: how to chek for the number of options in an app
>
> Hi all,
> Is there a way to check, without counting by hand within the manual, how
> many options are there for a command such as ls, more, bash, etc?
> If not, what's the shortest way of doing that through the man?
>
> Many thanks in advance!
> Ned
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: how to chek for the number of options in an app
     ` Ned
@      ` Sina Bahram
         ` Sean McMahon
  0 siblings, 1 reply; 8+ messages in thread
From: Sina Bahram @  UTC (permalink / raw)
  To: 'Speakup is a screen review system for Linux.'

Hi Ned,

About the ls -l | wc -l thing: yeh totally man: I just forgot to mention
grep in the first email ...

And about the '-' thing: well, that's true; however, don't the '-' and '--'
appear on the same line anyways? If they do, then why does it matter?

Oh, and to answer your question:

The regular expression: '-+' would check for 1 or more occurances of '-'
consecutively

Take care,
Sina

-----Original Message-----
From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
On Behalf Of Ned
Sent: Thursday, March 24, 2005 2:03 AM
To: Speakup is a screen review system for Linux.
Subject: Re: how to chek for the number of options in an app

Thanks Sina,

In your first post you said:
ls --help | wc -l
Wouldn't it only count the number of lines within the help file of the ls
command?
The grep is a much better idea, I tried something like:
ls --help | grep -c '-'
and it returned 51 because it counted both '-' and '--', but don't know how
to ... is there a logical or operator for situations like this?
I want to check for '-' or '--'
How to do that?

Many thanks!
Ned
----- Original Message -----
From: "Sina Bahram" <sbahram@nc.rr.com>
To: "'Speakup is a screen review system for Linux.'" 
<speakup@braille.uwo.ca>
Sent: Wednesday, March 23, 2005 11:28 PM
Subject: RE: how to chek for the number of options in an app


> Hi ned,
>
> ... To go back to what I said before, try playing with grep, so you could 
> at
> least set up a regular expression for only the lines that have commands on
> them ...
>
> Take care,
> Sina
>
> -----Original Message-----
> From: speakup-bounces@braille.uwo.ca 
> [mailto:speakup-bounces@braille.uwo.ca]
> On Behalf Of Ned
> Sent: Wednesday, March 23, 2005 3:19 PM
> To: Speakup is a screen review system for Linux.
> Subject: how to chek for the number of options in an app
>
> Hi all,
> Is there a way to check, without counting by hand within the manual, how
> many options are there for a command such as ls, more, bash, etc?
> If not, what's the shortest way of doing that through the man?
>
> Many thanks in advance!
> Ned
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 


_______________________________________________
Speakup mailing list
Speakup@braille.uwo.ca
http://speech.braille.uwo.ca/mailman/listinfo/speakup



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to chek for the number of options in an app
       ` Sina Bahram
@        ` Sean McMahon
  0 siblings, 0 replies; 8+ messages in thread
From: Sean McMahon @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Some commands have a -- some have a -.  Other times --option is synonomous
with -otheroption.  You have to look at each command's options to get a good
grep.
----- Original Message ----- 
From: "Sina Bahram" <sbahram@nc.rr.com>
To: "'Speakup is a screen review system for Linux.'" <speakup@braille.uwo.ca>
Sent: Thursday, March 24, 2005 12:08 AM
Subject: RE: how to chek for the number of options in an app


> Hi Ned,
>
> About the ls -l | wc -l thing: yeh totally man: I just forgot to mention
> grep in the first email ...
>
> And about the '-' thing: well, that's true; however, don't the '-' and '--'
> appear on the same line anyways? If they do, then why does it matter?
>
> Oh, and to answer your question:
>
> The regular expression: '-+' would check for 1 or more occurances of '-'
> consecutively
>
> Take care,
> Sina
>
> -----Original Message-----
> From: speakup-bounces@braille.uwo.ca [mailto:speakup-bounces@braille.uwo.ca]
> On Behalf Of Ned
> Sent: Thursday, March 24, 2005 2:03 AM
> To: Speakup is a screen review system for Linux.
> Subject: Re: how to chek for the number of options in an app
>
> Thanks Sina,
>
> In your first post you said:
> ls --help | wc -l
> Wouldn't it only count the number of lines within the help file of the ls
> command?
> The grep is a much better idea, I tried something like:
> ls --help | grep -c '-'
> and it returned 51 because it counted both '-' and '--', but don't know how
> to ... is there a logical or operator for situations like this?
> I want to check for '-' or '--'
> How to do that?
>
> Many thanks!
> Ned
> ----- Original Message -----
> From: "Sina Bahram" <sbahram@nc.rr.com>
> To: "'Speakup is a screen review system for Linux.'"
> <speakup@braille.uwo.ca>
> Sent: Wednesday, March 23, 2005 11:28 PM
> Subject: RE: how to chek for the number of options in an app
>
>
> > Hi ned,
> >
> > ... To go back to what I said before, try playing with grep, so you could
> > at
> > least set up a regular expression for only the lines that have commands on
> > them ...
> >
> > Take care,
> > Sina
> >
> > -----Original Message-----
> > From: speakup-bounces@braille.uwo.ca
> > [mailto:speakup-bounces@braille.uwo.ca]
> > On Behalf Of Ned
> > Sent: Wednesday, March 23, 2005 3:19 PM
> > To: Speakup is a screen review system for Linux.
> > Subject: how to chek for the number of options in an app
> >
> > Hi all,
> > Is there a way to check, without counting by hand within the manual, how
> > many options are there for a command such as ls, more, bash, etc?
> > If not, what's the shortest way of doing that through the man?
> >
> > Many thanks in advance!
> > Ned
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to chek for the number of options in an app
   ` Sina Bahram
     ` Ned
@    ` Lorenzo Taylor
  1 sibling, 0 replies; 8+ messages in thread
From: Lorenzo Taylor @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ah!  I think I got it!  Try this:

lorenzo@taylor:~$ ls --help |grep [-][-] |wc -l
44
lorenzo@taylor:~$

Note, though, that this only seems to work on commands where every short option
(-o) has a corresponding long option (--option).  You will need to look at the -h
or --help option first to see how the options may be specified and then tailor
the grep expression to fit the specific command.

Lorenzo
- -- 
"We decided that we should evaluate the Microsoft offerings first. Once we
realised what a powerful set of tools they were, it became self-evident this was
the right way to go down."

Microsoft: the right way to go down
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCQzakG9IpekrhBfIRAlx+AKCrrLM5sq4iXpfIokAPhQrpqo6WdQCgthIC
3jAmghpxr2nbLn+3GAXQPtU=
=s4bp
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 how to chek for the number of options in an app Ned
 ` Sean McMahon
 ` Sina Bahram
 ` Sina Bahram
   ` Ned
     ` Sina Bahram
       ` Sean McMahon
   ` Lorenzo Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).