head 1.18; access; symbols AS_CUI_0_5_0:1.17 AS_AFTER_RESTRUCTURING:1.17; locks; strict; comment @# @; 1.18 date 2002.12.18.11.18.20; author rse; state dead; branches; next 1.17; 1.17 date 2002.10.31.16.02.45; author thl; state Exp; branches; next 1.16; 1.16 date 2002.10.31.09.29.52; author thl; state Exp; branches; next 1.15; 1.15 date 2002.10.31.08.51.08; author thl; state Exp; branches; next 1.14; 1.14 date 2002.10.30.16.20.21; author thl; state Exp; branches; next 1.13; 1.13 date 2002.10.30.14.02.19; author thl; state Exp; branches; next 1.12; 1.12 date 2002.10.30.10.38.21; author thl; state Exp; branches; next 1.11; 1.11 date 2002.10.24.15.09.56; author thl; state Exp; branches; next 1.10; 1.10 date 2002.10.24.12.23.55; author thl; state Exp; branches; next 1.9; 1.9 date 2002.10.23.08.44.54; author thl; state Exp; branches; next 1.8; 1.8 date 2002.10.16.12.36.14; author thl; state Exp; branches; next 1.7; 1.7 date 2002.10.15.15.48.37; author rse; state Exp; branches; next 1.6; 1.6 date 2002.10.15.13.41.40; author thl; state Exp; branches; next 1.5; 1.5 date 2002.09.29.09.56.58; author rse; state Exp; branches; next 1.4; 1.4 date 2002.09.26.18.13.19; author rse; state Exp; branches; next 1.3; 1.3 date 2002.09.26.12.58.29; author rse; state Exp; branches; next 1.2; 1.2 date 2002.09.25.19.37.17; author rse; state Exp; branches; next 1.1; 1.1 date 2002.09.25.15.11.02; author rse; state Exp; branches; next ; desc @@ 1.18 log @polish for initial release @ text @## ## AS -- Accounting System ## Copyright (c) 2002 Cable & Wireless Deutschland ## Copyright (c) 2002 Ralf S. Engelschall ## ## This file is part of AS, an accounting system which can be ## found at http://as.is.eu.cw.com/ ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License ## as published by the Free Software Foundation; either version ## 2.0 of the License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ## USA, or contact The OSSP Project . ## ## as.pod: Unix Manual Page ## =pod =head1 NAME B -- Accounting System (AS) Command-Line Client =head1 SYNOPSIS I =over 4 B ... [B<-D>|B<--define> IC<=>I] [B<-v>|B<--verbose>] ... =back I =over 4 =item B B<-s>|B<--setup> =back I =over 4 =item B B<-d>|B<--download> =item B B<-u>|B<--update> [I ...] =item B B<-c>|B<--commit> [I ...] =back I =over 4 =item B I I [I] =item B B<-l>|B<--list> =item B B<-e>|B<--edit> [I ...] =item B B<-r>|B<--remove> I ... =back I =over 4 =item B B<--export> [B<--format> I] [B<-f>|B<--file> I] =item B B<--import> [B<--format> I] [B<-f>|B<--file> I] [B<--overwrite>] =back I =over 4 =item B B<-V>|B<--version> =item B B<-h>|B<--help> =back =head1 DESCRIPTION B is the Unix command-line client to the B (B). B is a database-backed system for accounting event time and tasks. The B tool allows performing both online and offline event accounting with B. The offline accounting mode also can be used without any B backend system, too. =head1 OPTIONS =head2 Common Configuration Options The following shared configuration command-line options exists: =over 4 =item B<-D>, B<--define> IC<=>I Set the configuration variable I to the value I. This temporarily (or persistently on option B<-s>|B<--setup>) overrides a possibly existing variable definition in C<$HOME/.as/rc>. =item B<-v>, B<--verbose> Enable printing of verbose message on F. =back =head2 Operation Options The following mutual exclusive operation command-line options exists: =over 4 =item B<-s>, B<--setup> This is for the (optional) initial setup of the program environment. It creates the directory C<$HOME/.as/> and the initial contents of the files C<$HOME/.as/rc>, C<$HOME/.as/serial>, C<$HOME/.as/events>, C<$HOME/.as/accounts> and C<$HOME/.as/bashrc>. =item B<-d>, B<--download> This updates the list of available accounts in C<$HOME/.as/accounts>. Keep in mind that only accounts are available to which the I has write access. =item B<-u>, B<--update> This merges in server information about floating events into C<$HOME/.as/events> and removes comitted events from C<$HOME/.as/events> which the server now declared fixed. If local event modifications conflict with the comitted server state, the event is locally tagged with a corresponding error message. =item B<-c>, B<--commit> Commit still pending events from local floating event queue to server. =item B<-l>, B<--list> List all events in local floating event queue. =item B<-e>, B<--edit> Edit all or a set of particular events in local floating event queue. =item B<-r>, B<--remove> Delete a set of particular events from local floating event queue. =item B<--export> Export the local floating event queue in either original (IC<=as/text>) or XML (IC<=as/xml>) format to F or I. =item B<--import> Import the local floating event queue in either original (IC<=as/text>) or XML (IC<=as/xml>) format from F or I. If option B<--overwrite> is given, the events are overwritten (instead of merged into) the local floating event queue. =item B<--format> I This specifies the import/export format. Default is C. =item B<-f>, B<--file> I This specifies a file instead of F (on B<--import>) and F (on B<--export>). =item B<--overwrite> Indicates an overwriting (instead of merging) operation on B<--import>. =item B<-V>, B<--version> Just print the program version. =item B<-h>, B<--help> Just print the program command line usage. =back =head1 ARGUMENTS The following command-line arguments exist: =over 4 =item I Name of an account. This can be specified in either descending or ascending notation. B starts with the root account, ends with the leaf account and uses the slash character as the separator. An example is "C". Descending notation resembles the Unix filesystem hierarchy. The advantage is that it is the more intuitive notation for humans when searching for unknown accounts. The disadvantage is that command-line argument auto-completion usually has to be applied multiple times in order to reach the account. B starts with the leaf account, ends with the root account and uses the dot character as the separator. An example is "C". Ascending notation resembles the DNS zone hierarchy. The advantage is that command-line argument auto-completion usually has to be applied only once (if the leaf account names are unique) or twice in order to reach the account. This way it allows fast searching for known accounts. The disadvantage is that it is the less intuitive notation and especially does not allow searching for unknown accounts. For command-line completion reasons, in both notations the separator character can be present as a leading and/or trailing character, too. The syntax in grammatical description follows: B ::= B | B B ::= B? B (B B)* B? B ::= B? B (B B)* B? B ::= /\// B ::= /\./ B ::= /[a-zA-Z0-9_-]+/ Examples: is/dev/prj/openpkg/pmod /is/dev/prj/openpkg/pmod is/dev/prj/openpkg/pmod/ /is/dev/prj/openpkg/pmod/ pmod.openpkg.prj.dev.is .pmod.openpkg.prj.dev.is pmod.openpkg.prj.dev.is. .pmod.openpkg.prj.dev.is. =item I Specification of the event time. The syntax as a whole is very complex, but mostly all elements are optional: B ::= ( B? /-/ B? )? =? B* B ::= B<24h-clock-time> || B B ::= B<24h-clock-time> || B B ::= B<24h-clock-time> || B B<24h-clock-time> ::= B /:/ B (/:/ B)? B ::= /^[01][0-9]|2[0-4]$/ B ::= /^[0-5][0-9]$/ B ::= /^[0-5][0-9]$/ B ::= B || B || B || B || B || B || B B ::= /^\.$/ B ::= /^\.$/ B ::= /^([1-9])?(:([0-9]|[0-5][0-9])?)?$/ B ::= /^([0-9]|[01][0-9]|2[0-4])?:([0-9]|[0-5][0-9])?$/ B ::= /^[0-9]*\.[0-9]+|[0-9]+\.$/ B ::= /^[0-9]*\/[1-9][0-9]*$/ B ::= /^0[0-9]$/ B ::= /^[1-9][0-9]+$/ Examples: reference | 00:06 00:15 01:30 06:00 10:00 -----------+------------------------------ short | :06 :15 1:30 6: 10: short | :6 0:15 - 6:0 10:0 short-hour | - - - 6 - frac-dec | .1 .25 1.5 6. 10.0 frac-std | 1/10 1/4 3/2 - - force-min | 06 - - - - short-min | - 15 90 360 600 =item I Optional prose text annotating an event. The only special semantic recognized in this text are hyperlinks in URI notation. Beside the standard URI schemes C, C and C the all schemes are recogized which were configured in the B. Example: Fixed website http://www.example.com/ =item I Auto-generated ISO-11578 Universally Unique Identifier (UUID) of an event. Example: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 =back =head1 FILES =head2 ${HOME}/.as/rc: =over 4 The runtime configuration file contains settings describing the communication between this frontend and the central database. B ::= B B* B ::= /^%!AS-RC-[0-9]\.[0-9]$/ B ::= B " " B "\n" B ::= "auth" | "pass" | "soap" | "mode" | "user" | "date" | "edit" | "hist" B ::= /'[^']*'/ # single-quoted string | /"[^"]*"/ # double-quoted string | /[^\n]+/ Example: auth as-john.doe pass mysecret soap http://as.example.com/soap mode commit user jd #if ommited, ${LOGNAME} is used date 20021024 #if ommited, local time is used edit /usr/bin/vi hist 9 #number of historic files being kept =head2 ${HOME}/.as/lock The lock file contains the dezimal number listing the PID of the process that created the lock. B ::= B B B ::= /^%!AS-LOCK-[0-9]\.[0-9]$/ B ::= [0-9]+ =head2 ${HOME}/.as/serial The serial file contains a dezimal number which is used and incremented when creating UUIDs. B ::= B B B ::= /^%!AS-SERIAL-[0-9]\.[0-9]$/ B ::= [0-9]+ =head2 ${HOME}/.as/events The events file contains the records of all events collected over time and not yet locked in the central database. B ::= B B* B ::= /^%!AS-EVENTS-[0-9]\.[0-9]$/ B ::= B B B B B B B B B [B] [# B] B ::= [a-zA-Z][a-zA-Z0-9]* B ::= B{8} ( /-/ B{4} ){3} /-/ B{12} B ::= B{8} B ::= [0-9]{1,5} B ::= [2-9][0-9]{3}([0][1-9]|[1][0-2])([0][1-9]|[12][0-9]|[3][01]) B ::= B<24h-clock-time> B ::= B<24h-clock-time> B ::= B<24h-clock-time> B ::= (\/[-a-zA-Z0-9]+)+ || (\.[-a-zA-Z0-9]+)+ B ::= .* B ::= .* B ::= [0-9a-fA-F] =head2 ${HOME}/.as/accounts The accounts file contains the records of all accounts the user has write access to. B ::= B B* B ::= /^%!AS-ACCOUNTS-[0-9]\.[0-9]$/ B ::= B B B B ::= Bbstract|Beal B ::= /sample-org/dep/vacation B ::= "approved absence, i.e. holiday" =back =head1 SHELL INTEGRATION If you are using B you can optionally use . $HOME/.as/bashrc in your C<$HOME/.bashrc> to get convinient command-line argument completion for the B command. With this feature enabled, pressing B when entering the I, I and I arguments allows you to quickly complete the argument and convert it into a canonical format. =head1 EXAMPLE $ as --setup User foo Pass bar SOAP https://as.is.eu.cw.com/soap Mode commit $ as --update $ as 1:30 is/dev/meeting/weekly $ as 1/2 is/dev/prj/as/dev $ as -l $ as -c =head1 SEE ALSO B (AS) https://as.is.eu.cw.com/ =head1 HISTORY The B (AS) was designed and implemented by the I of the I division at I between September 2002 and December 2002. =head1 AUTHORS Ralf S. Engelschall Erse@@engelschall.comE Thomas Lotterer Ethomas@@lotterer.netE =cut @ 1.17 log @implement time syntaxes and align with manual @ text @@ 1.16 log @slash2dot; dot2slash; accept dot in events file; remove DEBUG traces @ text @d277 1 a277 1 B ::= /^[0-9]|[01][0-9]|2[0-4]$/ d279 1 a279 1 B ::= /^[0-9]|[0-5][0-9]$/ d281 1 a281 1 B ::= /^[0-9]|[0-5][0-9]$/ d283 3 a285 1 B ::= B d289 1 a289 3 || B || B || B d291 1 a291 1 B ::= /^([0-9]*:[0-5][0-9]|[0-9]+:)$/ d293 1 a293 1 B ::= /^([0-9]*\.[0-9]+|[0-9]+\.)$/ d295 1 a295 1 B ::= /^[0-9]*\/[1-9][0-9]*$/ d297 1 a297 1 B ::= /^0[0-9]$/ d299 1 a299 1 B ::= /^[0-9]*:[0-9]$/ d301 1 a301 1 B ::= /^[0-9]$/ d303 3 a305 1 B ::= /^[1-9][0-9]+$/ d309 9 a317 8 reference 00:06 00:15 01:30 06:00 27:00 amount-std :06 0:15 1:30 06:00 27: amount-frac-dec 0.1 0.25 1.5 6. 27.0 amount-frac-std 1/10 1/4 3/2 - - amount-force-min 06 - - - - amount-abbr-min :6 - - 6:0 27:0 amount-abbr-hour - - - 6 - amount-abbr-min - 15 90 360 1620 @ 1.15 log @calccrc32; keep a history before overwriting @ text @d424 1 @ 1.14 log @writeevents; do_newevent; splittimespec @ text @d355 1 a355 1 "edit" d370 1 @ 1.13 log @readevents @ text @d275 1 a275 1 B<24h-clock-time> ::= B (/:/ B (/:/ B)?)? d403 1 a403 1 B B B B @ 1.12 log @implement time-spec shell completion @ text @d267 1 a267 1 B ::= ( B? /-/ B? )? =? B* d269 1 a269 1 B ::= B<24h-clock-time> || B d402 1 a402 1 B ::= B B B B d406 1 a406 1 B ::= john.doe d408 1 a408 1 B ::= f81d4fae-7dec-11d0-a765-00a0c91e6bf6 d410 1 a410 1 B ::= a89b389c d412 1 a412 1 B ::= 42 d414 1 a414 1 B ::= 2002-10-01 d416 1 a416 1 B ::= 00:00 d418 1 a418 1 B ::= 24:00 d420 1 a420 1 B ::= 03:00 d422 1 a422 1 B ::= /sample-org/dep/vacation d424 1 a424 1 B ::= "important recreation" d426 3 a428 1 B ::= ERROR: ... @ 1.11 log @user/date are defines only; implemented simple sanity check @ text @d267 1 a267 3 B ::= ( B /-/ B /=/ )* B | B ( /-/ B )* /=/ B | B* /-/ B /=/ B d269 1 a269 1 B ::= B<24h-clock-time> d271 1 a271 1 B ::= B<24h-clock-time> d273 1 a273 3 B ::= B | B | B d283 7 a289 1 B ::= /^([0-9]*:[0-5][0-9]|[0-9]+:)$/ d291 1 a291 1 B ::= /^([0-9]*\.[0-9]+|[0-9]+\.)$/ d293 1 a293 1 B ::= /^[0-9]*\/[1-9][0-9]*$/ d295 1 a295 1 B ::= /^0[0-9]$/ d297 1 a297 1 B ::= /^[0-9]*:[0-9]$/ d299 1 a299 1 B ::= /^[0-9]$/ d301 3 a303 1 B ::= /^[1-9][0-9]+$/ @ 1.10 log @readaccounts() and accounts command line completion working @ text @d67 1 a67 1 =item B [B<--user> I] [B<--date> I] I I [I] d349 3 a351 1 B ::= "auth" | "pass" | "soap" | "mode" | "user" | "edit" d363 2 a364 1 user jd @ 1.9 log @fix nesting @ text @d67 1 a67 1 =item B [B<-c>|B<--commit>] [B<--user> I] [B<--date> I] I I [I] d349 1 a349 1 B ::= "user" | "pass" | "soap" | "mode" d357 1 a357 1 user john.doe d361 2 @ 1.8 log @typo; newline is not checked @ text @d338 2 a360 2 =back @ 1.7 log @major cleanups from this afternoon @ text @d116 1 a116 1 This temporarily (or persistently on option B|B<--setup>) overrides a d343 1 a343 1 B ::= /^%!AS-RC-[0-9]\.[0-9]\n$/ d369 1 a369 1 B ::= /^%!AS-LOCK-[0-9]\.[0-9]\n$/ d380 1 a380 1 B ::= /^%!AS-SERIAL-[0-9]\.[0-9]\n$/ d391 1 a391 1 B ::= /^%!AS-EVENTS-[0-9]\.[0-9]\n$/ d426 1 a426 1 B ::= /^%!AS-ACCOUNTS-[0-9]\.[0-9]\n$/ @ 1.6 log @SYNOPSIS and FILES section @ text @d35 1 a35 1 B B<-s>|B<--set> [[IC<=>I] [...]] d37 31 a67 1 B B<-d>|B<--download> d69 1 a69 2 B B<-c>|B<--commit> [-u B] [B] [B-][B=]B B [B] d71 1 a71 2 B B<-q>|B<--queue> [-u B] [B] [B-][B=]B B [B] d73 1 a73 1 B B<-l>|B<--list> d75 3 a77 1 B B<-e>|B<--edit> [I [...]] d79 1 a79 1 B B<-r>|B<--remove> [I [...]] d81 1 a81 1 B B<-s>|B<--sync> [I [...]] d83 1 a83 1 B B<-o>|B<--out> d85 1 a85 3 B B<-g>|B<--grep> [-u B] [B] [B-][B=]B B [B] [# sysfeedback] d87 1 a87 1 B B<-i>|B<--in> d89 1 a89 1 B B<-V>|B<--version> d91 1 a91 1 B B<-h>|B<--help> d93 3 a95 1 B B<-v>|B<--verbose> d101 1 a101 1 and tasks. The B tool for performing both online and offline event d107 1 a107 1 =head2 Configuration Options d113 1 a113 1 =item B<-o>, B<--option> IC<=>I] d116 2 a117 1 This overrides a possibly existing variable definition in C<$HOME/.as/rc>. d133 1 a133 1 This is for the initial setup of the program environment. It mainly d135 2 a136 1 files C<$HOME/.as/rc>, C<$HOME/.as/serial> and C<$HOME/.as/queue>. d138 1 a138 1 =item B<-u>, B<--update> d141 1 a141 1 Keep in mind that only accounts are available to which the I d144 1 a144 1 =item B<-q>, B<--query> d146 5 a150 1 Query information about a particular account I. d154 1 a154 1 Commit still pending events from queue to server. d158 17 a174 1 List still pending events in queue. d176 4 a179 1 =item B<-d>, B<--delete> d181 1 a181 1 Delete particular events in queue. d183 8 a190 1 =item B<-e>, B<--edit> d192 1 a192 1 Edit particular (or all) events in queue. d210 1 a210 1 =item I d267 5 a271 2 B ::= ( B /-/ B /=/ )* B | B /-/ B* /=/ B d273 5 a277 1 B ::= B<24h-clock-time> d279 1 a279 1 B ::= B<24h-clock-time> d281 1 a281 1 B<24h-clock-time> ::= B<> d283 17 a299 4 B ::= B | B | B | B d303 8 a310 2 time-spec canonical 01:23 01:23 a317 1 An example is "C". d319 5 a323 1 =item I d328 4 d343 1 a343 3 B ::= %!AS-RC-@@@@VERSION@@@@ B ::= B B? d345 1 a345 1 B ::= B|B|B|B d347 1 a347 1 B ::= john.doe d349 3 a351 1 B ::= mysecret d353 1 a353 1 B ::= http://as.example.com/soap d355 4 a358 1 B ::= B|B d369 1 a369 1 B ::= %!AS-LOCK-@@@@VERSION@@@@ d380 1 a380 1 B ::= %!AS-SERIAL-@@@@VERSION@@@@ d391 1 a391 1 B ::= %!AS-EVENTS-@@@@VERSION@@@@ d426 1 a426 1 B ::= %!AS-ACCOUNTS-@@@@VERSION@@@@ a437 59 The available options B are: =over 4 =item B The name of the user for remote B system authentication. Example: "C". =item B The password of the user for remote B system authentication. Example: "C". =item B The URL of the remote B system's I service. Example: C =item B ??? start end FIXME =item B Whether an entered event is immediately committed to the remote B system (value C and same as including option B<--commit> on the command line) or whether it is just added for later bulk-commitment to the C<$HOME/.as/queue> file (value C and the default). =back =head2 $HOME/.as/accounts The list of accounts which are available to the user for writing. This is usually automatically retrieved from the B system by option B<--update>, but could be established manually in case of pure offline usage. =over 4 =item The format is: B ::= B B* B ::= /%!AS-ACCOUNTS-\d+\.\d+\n/ B ::= B B? B ::= /.+/ =back =head2 $HOME/.as/serial =head2 $HOME/.as/queue =head2 $HOME/.as/lock d453 4 a456 3 UserName foo Password bar Server https://as.is.eu.cw.com/soap d459 2 a460 2 $ as is/dev/meeting/weekly 1:30 $ as is/dev/prj/as/dev 1/2 d475 3 a477 1 =head1 AUTHOR d479 1 a479 3 Ralf S. Engelschall rse@@engelschall.com www.engelschall.com @ 1.5 log @flush work on as.pod of yesterday @ text @d35 1 a35 2 B B<-s>|B<--setup> d37 1 a37 2 B B<-u>|B<--update> d39 27 a65 31 B [B<-o>|B<--option> IC<=>I] [B<-V>|B<--version>] [B<-h>|B<--help>] [B<-v>|B<--verbose>] ... B B<-q>|B<--query> I B [B<-c>|B<--commit>] I I [I] B B<-l>|B<--list> B B<-d>|B<--delete> I [...] B B<-e>|B<--edit> [I [...]] B B<-c>|B<--commit> [I [...]] d234 2 a235 5 Unique id of an event. It is a string of the format IC<@@>IC<:>I. An example is "C". Event ids are auto-generated by the B client program and only used for uniquely identifying existing events. d241 29 a269 1 =head2 $HOME/.as/rc d271 1 a271 1 The user-supplied configuration file. d273 58 a330 1 =over 4 d332 1 a332 1 =item The format is: d334 1 a334 1 B ::= B* d336 1 a336 1 B ::= B B? @ 1.4 log @- add more documentation - add licenses @ text @d252 13 a264 2 The user-supplied configuration file. The syntax is "I I". The available options are: @ 1.3 log @more client documentation @ text @d1 25 d75 5 a79 4 B is the Unix command-line client to the B (AS). It is a tool for both online and offline event accounting. ... d157 1 a157 1 ascending notation. d180 26 d208 2 a209 2 Specification of the event time. It's syntax is described by the following XBNF grammar: d215 1 d225 5 d247 76 @ 1.2 log @second cut for manual page @ text @d57 2 d65 3 d70 2 d74 2 d92 20 d122 68 d213 6 @ 1.1 log @add first cut for command line client @ text @d10 43 a52 8 ~/.as/rc user rse pass foobar server https://as.is.eu.cw.com/soap ~/.as/accounts is.eu.cw.com This is fdsfdfdpo is.eu.cw.cdf dThs is.. d55 52 a106 2 # update account list B B<-u> d108 2 a109 2 # list still pending accountings B B<-l> d111 1 a111 2 # commit still pending accountings B B<-c> d113 3 a115 1 B I I