Debian Codegraph @

BibTcl/main.tcl

raw
1 #!/usr/local/bin/wish -f
2 ###----------------------------------------------------------------------------
3 ### main.tcl
4 ###----------------------------------------------------------------------------
5
6 set infiles {}
7 set outfile {}
8 set macrofile {}
9 set the_db [new]
10
11 for {set i 0} {$i<$argc} {incr i} {
12 set arg [lindex $argv $i]
13 if { $arg == "-o" } {
14 incr i
15 set outfile [lindex $argv $i]
16 } else if { $arg == "-q" } {
17 bibtool quiet=[eval ![bibtool quiet]]
18 } else if { $arg == "-s" } {
19 bibtool sort=[eval ![bibtool sort]]
20 } else if { $arg == "-S" } {
21 bibtool sort=[eval ![bibtool sort]]
22 bibtool sort.reverse=[eval ![bibtool sort.reverse]]
23 } else {
24 lappend infiles $arg
25 }
26 }
27
28
29 foreach file $infiles {
30 bibtool read $the_db $file
31 }
32
33 if {[bibtool make.key]} {
34 } else {
35 }
36
37 if {[bibtool sort]} {
38 bibtool sort $the_db
39 }
40
41 bibtool write $outfile