/[eiffelstudio]/FreeELKS/trunk/library/kernel/arguments.e
ViewVC logotype

Diff of /FreeELKS/trunk/library/kernel/arguments.e

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 91476 by ericb, Sat Feb 4 16:54:39 2006 UTC revision 91477 by ericb, Sun Jan 14 09:47:13 2007 UTC
# Line 76  feature -- Status report Line 76  feature -- Status report
76                          -- at what position?                          -- at what position?
77                          -- If one of the arguments in list of space-separated arguments                          -- If one of the arguments in list of space-separated arguments
78                          -- is `Xopt', where `X' is the current `option_sign',                          -- is `Xopt', where `X' is the current `option_sign',
79                          -- then index of this argument in list;                          -- then index of this argument in list;
80                          -- else 0.                          -- else 0.
81                  require                  require
82                          opt_non_void: opt /= Void                          opt_non_void: opt /= Void
# Line 92  feature -- Status report Line 92  feature -- Status report
92                          loop                          loop
93                                  i := i + 1                                  i := i + 1
94                          end                          end
95                          if i <= argument_count then                          if i <= argument_count then
96                                  Result := i                                  Result := i
97                          end                          end
98                  end                  end
99    
100          index_of_beginning_with_word_option (opt: STRING): INTEGER is          index_of_beginning_with_word_option (opt: STRING): INTEGER is
101                          -- Does command line specify argument beginning with word                          -- Does command line specify argument beginning with word
102                          -- option `opt' and, if so, at what position?                          -- option `opt' and, if so, at what position?
103                          -- If one of the arguments in list of space-separated arguments                          -- If one of the arguments in list of space-separated arguments
104                          -- is `Xoptxx', where `X' is the current `option_sign', 'xx'                          -- is `Xoptxx', where `X' is the current `option_sign', 'xx'
105                          -- is arbitrary, possibly empty sequence of characters,                          -- is arbitrary, possibly empty sequence of characters,
106                          -- then index of this argument in list;                          -- then index of this argument in list;
107                          -- else 0.                          -- else 0.
108                  require                  require
109                          opt_non_void: opt /= Void                          opt_non_void: opt /= Void
# Line 134  feature -- Status report Line 134  feature -- Status report
134                          -- Does command line specify character option `o' and, if so,                          -- Does command line specify character option `o' and, if so,
135                          -- at what position?                          -- at what position?
136                          -- If one of the space-separated arguments is of the form `Xxxoyy',                          -- If one of the space-separated arguments is of the form `Xxxoyy',
137                          -- where `X' is the current `option_sign', `xx' and `yy'                          -- where `X' is the current `option_sign', `xx' and `yy'
138                          -- are arbitrary, possibly empty sequences of characters,                          -- are arbitrary, possibly empty sequences of characters,
139                          -- then index of this argument in list of arguments;                          -- then index of this argument in list of arguments;
140                          -- else 0.                          -- else 0.
# Line 155  feature -- Status report Line 155  feature -- Status report
155                  end                  end
156    
157          separate_character_option_value (o: CHARACTER): STRING is          separate_character_option_value (o: CHARACTER): STRING is
158                          -- The value, if any, specified after character option `o' on                          -- The value, if any, specified after character option `o' on
159                          -- the command line.                          -- the command line.
160                          -- This is one of the following (where `X' is the current                          -- This is one of the following (where `X' is the current
161                          -- `option_sign', `xx' and 'yy' are arbitrary, possibly empty                          -- `option_sign', `xx' and 'yy' are arbitrary, possibly empty
162                          -- sequences of characters):                          -- sequences of characters):
163                          --   `val' if command line includes two consecutive arguments                          --   `val' if command line includes two consecutive arguments
# Line 183  feature -- Status report Line 183  feature -- Status report
183                  end                  end
184    
185          separate_word_option_value (opt: STRING): STRING is          separate_word_option_value (opt: STRING): STRING is
186                          -- The value, if any, specified after word option `opt' on the                          -- The value, if any, specified after word option `opt' on the
187                          -- command line.                          -- command line.
188                          -- This is one of the following (where `X' is the current `option_sign'):                          -- This is one of the following (where `X' is the current `option_sign'):
189                          --   `val' if command line includes two consecutive arguments                          --   `val' if command line includes two consecutive arguments
# Line 216  feature -- Status report Line 216  feature -- Status report
216                  end                  end
217    
218          coalesced_character_option_value (o: CHARACTER): STRING is          coalesced_character_option_value (o: CHARACTER): STRING is
219                          -- The value, if any, specified for character option `o' on                          -- The value, if any, specified for character option `o' on
220                          -- the command line.                          -- the command line.
221                          -- Defined as follows (where 'X' is the current 'option_sign' and                          -- Defined as follows (where 'X' is the current 'option_sign' and
222                          -- 'xx' is an arbitrary, possibly empty sequence of characters):                          -- 'xx' is an arbitrary, possibly empty sequence of characters):
# Line 246  feature -- Status report Line 246  feature -- Status report
246                  end                  end
247    
248          coalesced_word_option_value (opt: STRING): STRING is          coalesced_word_option_value (opt: STRING): STRING is
249                          -- The value, if any, specified for word option `opt' on the                          -- The value, if any, specified for word option `opt' on the
250                          -- command line.                          -- command line.
251                          -- Defined as follows (where X is the current `option_sign'):                          -- Defined as follows (where X is the current `option_sign'):
252                          --   `val' if command line includes an argument of the form `Xoptval'                          --   `val' if command line includes an argument of the form `Xoptval'
# Line 271  feature -- Status report Line 271  feature -- Status report
271    
272          option_sign: CHARACTER_REF is          option_sign: CHARACTER_REF is
273                          -- The character used to signal options on the command line.                          -- The character used to signal options on the command line.
274                          -- This can be '%U' if no sign is necesary for the argument                          -- This can be '%U' if no sign is necesary for the argument
275                          -- to be an option                          -- to be an option
276                          -- Default is '-'                          -- Default is '-'
277                  once                  once
# Line 283  feature -- Status setting Line 283  feature -- Status setting
283    
284          set_option_sign (c: CHARACTER) is          set_option_sign (c: CHARACTER) is
285                          -- Make `c' the option sign.                          -- Make `c' the option sign.
286                          -- Use'%U' if no sign is necesary for the argument to                          -- Use'%U' if no sign is necesary for the argument to
287                          -- be an option                          -- be an option
288                  do                  do
289                          option_sign.set_item (c)                          option_sign.set_item (c)
# Line 304  feature {NONE} -- Implementation Line 304  feature {NONE} -- Implementation
304    
305          option_word_equal (arg, w: STRING): BOOLEAN is          option_word_equal (arg, w: STRING): BOOLEAN is
306                          -- Is `arg' equal to the word option `w'?                          -- Is `arg' equal to the word option `w'?
307                    require
308                            arg_not_void: arg /= Void
309                            w_not_void: w /= Void
310                  do                  do
311                          if option_sign.item = '%U' then                          if option_sign.item = '%U' then
312                                  Result := arg.is_equal (w)                                  Result := arg.is_equal (w)
313                          elseif arg.item (1) = option_sign.item then                          elseif not arg.is_empty and then arg.item (1) = option_sign.item then
314                                  Result := arg.substring (2, arg.count).is_equal (w)                                  Result := arg.substring (2, arg.count).is_equal (w)
315                          end                          end
316                  end                  end
317    
318          option_word_begins_with (arg, w: STRING): BOOLEAN is          option_word_begins_with (arg, w: STRING): BOOLEAN is
319                          -- Does `arg' begin with the word option `w'?                          -- Does `arg' begin with the word option `w'?
320                    require
321                            arg_not_void: arg /= Void
322                            w_not_void: w /= Void
323                  do                  do
324                          if option_sign.item = '%U' and then arg.count >= w.count then                          if option_sign.item = '%U' and then arg.count >= w.count then
325                                  Result := arg.substring (1, w.count).is_equal (w)                                  Result := arg.substring (1, w.count).is_equal (w)
# Line 324  feature {NONE} -- Implementation Line 330  feature {NONE} -- Implementation
330    
331          option_character_equal (arg: STRING; c: CHARACTER): BOOLEAN is          option_character_equal (arg: STRING; c: CHARACTER): BOOLEAN is
332                          -- Does `arg' contain the character option `c'?                          -- Does `arg' contain the character option `c'?
333                    require
334                            arg_not_void: arg /= Void
335                  do                  do
336                          if option_sign.item = '%U' then                          if option_sign.item = '%U' then
337                                  Result := arg.has (c)                                  Result := arg.has (c)

Legend:
Removed from v.91476  
changed lines
  Added in v.91477

  ViewVC Help
Powered by ViewVC 1.1.23