continue work on the glossary tool
FossilOrigin-Name: 9c3e69aa10132d8247a74d01c3e1fd52464bb2a244ad01cb8f9a78df9b6bee6b
This commit is contained in:
parent
fdc7bc7d65
commit
8617da6779
1 changed files with 35 additions and 4 deletions
|
@ -111,6 +111,41 @@ examples, they will be displayed after the description.
|
||||||
field:ex2 '{n/a} s:eq? [ field:ex2 s:with-format 'Example_#2:\n%s\n\n puts<formatted> ] -if ;
|
field:ex2 '{n/a} s:eq? [ field:ex2 s:with-format 'Example_#2:\n%s\n\n puts<formatted> ] -if ;
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
# Begin Processing
|
||||||
|
|
||||||
|
This application can take a variable number of arguments.
|
||||||
|
|
||||||
|
I first check to make sure at least one was passed. If not, just exit.
|
||||||
|
|
||||||
|
~~~
|
||||||
|
sys:argc n:zero? [ #0 unix:exit ] if
|
||||||
|
~~~
|
||||||
|
|
||||||
|
If execution reaches this point there's at least one argument. I use a
|
||||||
|
loop to store arguments into an array.
|
||||||
|
|
||||||
|
~~~
|
||||||
|
'Args d:create #32 allot
|
||||||
|
#0 sys:argc [ dup sys:argv s:keep over &Args + store n:inc ] times drop
|
||||||
|
~~~
|
||||||
|
|
||||||
|
And then populate constants for each one I care about.
|
||||||
|
|
||||||
|
~~~
|
||||||
|
#0 &Args + fetch 'QUERY s:const
|
||||||
|
#1 &Args + fetch 'TARGET s:const
|
||||||
|
#2 &Args + fetch 'TARGET2 s:const
|
||||||
|
~~~
|
||||||
|
|
||||||
|
FUTURE:
|
||||||
|
|
||||||
|
:process-arguments
|
||||||
|
QUERY
|
||||||
|
'help [ display-help ] s:case
|
||||||
|
'describe [ find-and-display-entry ] s:case
|
||||||
|
'export [ handle-exports ] s:case
|
||||||
|
'edit [ handle-edits ] s:case
|
||||||
|
drop ;
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -133,10 +168,6 @@ assumes the first argument is the type of search and the second
|
||||||
is name of a word, class, or other detail to search for. Grab them
|
is name of a word, class, or other detail to search for. Grab them
|
||||||
and save as `QUERY` and `TARGET`.
|
and save as `QUERY` and `TARGET`.
|
||||||
|
|
||||||
~~~
|
|
||||||
#0 sys:argv 'QUERY s:const
|
|
||||||
#1 sys:argv 'TARGET s:const
|
|
||||||
~~~
|
|
||||||
|
|
||||||
The *words.tsv* has the following fields:
|
The *words.tsv* has the following fields:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue