#!/usr/bin/guile16 -s
!#
(use-modules (ice-9 getopt-long)
	     (alterator common)

	     (alterator algo)
	     (alterator telegraph)
	     (alterator autoinstall)
	     (alterator ensign))

(define cmdline (command-line))
(define progname (car cmdline))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (usage progname)
  (format #t "Usage:  ~A script~%" progname)
  (format #t "  -h, --help     display help screen~%")
  (format #t "  Report bugs to <inger@altlinux.ru>~%")
  (quit))

(define option-spec
  '((help  (single-char #\h) (value #f))))

(define options (getopt-long cmdline option-spec))

(and (option-ref options 'help #f) (usage progname))

(alterator-init)

(define script-file (or (cond-car (option-ref options '() #f)) (usage progname)))

(telegraph
  (autoinstall script-file)
  (ensign))

(telegraph-start)
