mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/bin/overrides/gnucash-make-guids: new file -- mostly content
of ../gnucash-make-guids.in. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6130 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
917f74df63
commit
5622e77df8
36
src/bin/overrides/gnucash-make-guids
Executable file
36
src/bin/overrides/gnucash-make-guids
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
exec gnucash-env guile -s "$0" "$@"
|
||||
!#
|
||||
|
||||
(define (usage)
|
||||
(display "Usage: gnucash-make-guids [number-to-make (default is 100)]\n")
|
||||
(exit 1))
|
||||
|
||||
(define args (cdr (program-arguments)))
|
||||
(define num-to-make 100)
|
||||
|
||||
;; Too many arguments
|
||||
(if (> (length args) 1)
|
||||
(usage))
|
||||
|
||||
(if (= (length args) 1)
|
||||
(let ((arg (string->number (car args))))
|
||||
(if (not (number? arg))
|
||||
(usage))
|
||||
(set! arg (inexact->exact arg))
|
||||
(if (<= arg 0)
|
||||
(usage))
|
||||
(set! num-to-make arg)))
|
||||
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
(gnc:module-load "gnucash/engine" 0)
|
||||
|
||||
(let loop ((remaining num-to-make))
|
||||
(display (gnc:guid-new)) (newline)
|
||||
(if (> remaining 1)
|
||||
(loop (- remaining 1))))
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
Loading…
Reference in New Issue
Block a user