From d9b61718b924b348b2ea3b628a35c1590103a7d8 Mon Sep 17 00:00:00 2001 From: MatthewRock Date: Sat, 17 Sep 2016 22:21:46 +0200 Subject: [PATCH 1/3] Deprecate one-dash longflags --- src/doc/ecl.man.in | 41 +++++++++++++++++++++----------------- src/lsp/cmdline.lsp | 48 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 25 deletions(-) diff --git a/src/doc/ecl.man.in b/src/doc/ecl.man.in index 926a2e8d1..4d4ddabcf 100644 --- a/src/doc/ecl.man.in +++ b/src/doc/ecl.man.in @@ -1,4 +1,4 @@ -.TH ECL 1 2016-05-10 +.TH ECL 1 2016-09-17 .UC 4 .SH NAME ecl \- Embeddable Common Lisp @@ -7,23 +7,28 @@ ecl \- Embeddable Common Lisp \fBecl\fP [\fB-?\fP | \fB--help\fP] .br -[\fB-dir\fP \fIdir\fP] [\fB-load\fP \fIfile\fP] [\fB-shell\fP \fIfile\fP] [\fB-eval\fP \fIexpr\fP] +[\fB--dir\fP \fIdir\fP] [\fB--load\fP \fIfile\fP] [\fB--shell\fP \fIfile\fP] [\fB--eval\fP \fIexpr\fP] .br -[\fB-norc\fP] [\fB-hp\fP | \fB-nohp\fP] +[\fB--norc\fP] [\fB--hp\fP | \fB--nohp\fP] +.br +[\fB--debug\fP | \fB--nodevbug\fP] .br [\fB--c-stack\fP \fIsize\fP] [\fB--lisp-stack\fP \fIsize\fP] .br [\fB--heap-size\fP \fIsize\fP] [\fB--frame-stack\fP \fIsize\fP] .br -[[\fB-o\fP \fIofile\fP] [\fB-c\fP [\fIcfile\fP]] [\fB-h\fP [\fIhfile\fP]] [\fB-data\fP [\fIdatafile\fP]] +[[\fB-o\fP \fIofile\fP] [\fB-c\fP [\fIcfile\fP]] [\fB-h\fP [\fIhfile\fP]] [\fB--data\fP [\fIdatafile\fP]] .br - [\fB-s\fP] [\fB-q\fP] \fB-compile\fP \fIfile\fP] + [\fB-s\fP] [\fB-q\fP] \fB--compile\fP \fIfile\fP] .br -[[\fB-o\fP \fIofile\fP] \fB-link\fP \fIfile\fP+] +[[\fB-o\fP \fIofile\fP] \fB--link\fP \fIfile\fP+] .br [\fB--input-encoding\fP \fIexternal-format\fP] [\fB--output-encoding\fP \fIexternal-format\fP] .br [\fB--error-encoding\fP \fIexternal-format\fP] [\fB--encoding\fP \fIexternal-format\fP] +.br +\fBDEPRECATION NOTE:\fP one-dash versions of long flags(e.g. \fB-eval\fP or \fB-data\fP) are deprecated; you should use two-dash versions (e.g. \fB--eval\fP or \fB--data\fP) now. + .SH DESCRIPTION .sp @@ -68,7 +73,7 @@ interactive lisp. .B \-?, \-\-help Shows the help prompt without running the ECL. .TP -.BI \-norc +.BI \-\-norc Do not load configuration files at startup. .TP .BI \-\-version @@ -78,29 +83,29 @@ Prints the current version of ECL, without running the ECL. Turned on by default, this enables the debugging in the setup phase, so that you can debug your \.rc files. .TP -.BI \-nodebug +.BI \-\-nodebug Run without debugging setup phase, meaning that errors prevent ECL from starting up. .TP -.BI \-eval " file" +.BI \-\-eval " file" Evaluate the .I file before starting the ECL, or loading the \.rc files. .TP -.BI \-shell " file" +.BI \-\-shell " file" Executes the given .I file and exits, without providing a read-eval-print loop. If you want to use lisp as a scripting language, you can write -.BR "#!usr/bin/env ecl -shell" +.BR "#!usr/bin/env ecl --shell" on the first line of the file to be executed, and then ECL will be automatically invoked. .TP -.BI \-load " file" +.BI \-\-load " file" Load source .I file before starting ECL. .TP -.BI \-dir " directory" +.BI \-\-dir " directory" Use .I directory as a system directory. @@ -167,12 +172,12 @@ When compiling name the intermediary C file .I cfile and do not delete it afterwards. .TP -.BI \-data " [datafile]" +.BI \-\-data " [datafile]" Dumps compiler data into \fIdatafile\fP or, if not supplied, into a file named after the source file, but with .data as extension. .TP -.BI \-compile " file" +.BI \-\-compile " file" Translates .I file to C and invokes the local C compiler to produce a @@ -181,10 +186,10 @@ native code program. .BI \-q Short for quiet - produce less notes. .TP -.BI \-hp +.BI \-\-hp This option is deprecated and doesn't do anything. .TP -.BI \-nodp +.BI \-\-nodp This option is deprecated and doesn't do anything. .TP .BI \-s @@ -204,7 +209,7 @@ who can be reached at the ECL mailing list. .TP .BR "~/.ecl, ~/.eclrc" Default initialization files loaded at startup unless the option -.BR \-norc +.BR \-\-norc is provided. (if they exist). .SH SEE ALSO diff --git a/src/lsp/cmdline.lsp b/src/lsp/cmdline.lsp index 0a9c5f42c..ae21725b2 100644 --- a/src/lsp/cmdline.lsp +++ b/src/lsp/cmdline.lsp @@ -23,11 +23,11 @@ (defparameter *help-message* " Usage: ecl [-? | --help] - [-dir dir] [-load file] [-shell file] [-eval expr] [-rc | -norc] [-hp | -nohp] + [--dir dir] [--load file] [--shell file] [--eval expr] [--rc | --norc] [--hp | --nohp] [--c-stack size] [--lisp-stack size] [--heap-size size] [--frame-stack size] - [[-o ofile] [-c [cfile]] [-h [hfile]] [-data [datafile]] [-s] [-q] - -compile file] - [[-o ofile] -link file+] + [[-o ofile] [-c [cfile]] [-h [hfile]] [--data [datafile]] [-s] [-q] + --compile file] + [[-o ofile] --link file+] [--input-encoding external-format] [--output-encoding external-format] [--error-encoding external-format] [--encoding external-format] [--trap-fpe | --no-trap-fpe] @@ -59,20 +59,31 @@ appeared after a '--'.") '(("--help" 0 #0=(progn (princ *help-message* *standard-output*) (quit)) :noloadrc) ("-?" 0 #0# :noloadrc) ("-norc" 0 nil :noloadrc) + ("--norc" 0 nil :noloadrc) ("--version" 0 (progn (setf quit 0) (format *standard-output* "ECL ~A~%" (lisp-implementation-version))) :noloadrc) ("-debug" 0 (setf *command-break-enable* t)) + ("--debug" 0 (setf *command-break-enable* t)) ("-nodebug" 0 (setf *command-break-enable* nil)) + ("--nodebug" 0 (setf *command-break-enable* nil)) ("-eval" 1 (eval (read-from-string 1))) + ("--eval" 1 (eval (read-from-string 1))) ("-shell" 1 (progn (setq quit 0) (setq ext:*unprocessed-ecl-command-args* (rest 1)) (load (first (rest 1)) :verbose nil)) :stop) + ("--shell" 1 (progn (setq quit 0) + (setq ext:*unprocessed-ecl-command-args* (rest 1)) + (load (first (rest 1)) :verbose nil)) + :stop) ("-load" 1 (load 1 :verbose verbose)) + ("--load" 1 (load 1 :verbose verbose)) ("-dir" 1 (setf (logical-pathname-translations "SYS") `(("**;*.*" ,(merge-pathnames "**/*.*" (truename 1)))))) + ("--dir" 1 (setf (logical-pathname-translations "SYS") + `(("**;*.*" ,(merge-pathnames "**/*.*" (truename 1)))))) ("--heap-size" 1 (ext:set-limit 'ext:heap-size (read-from-string 1))) ("--lisp-stack" 1 (ext:set-limit 'ext:lisp-stack (read-from-string 1))) ("--frame-stack" 1 (ext:set-limit 'ext:frame-stack (read-from-string 1))) @@ -92,9 +103,23 @@ appeared after a '--'.") (progn (setq quit (if (nth-value 3 - (compile-file 1 :output-file output-file :c-file c-file - :h-file h-file :data-file data-file - :verbose verbose :system-p system-p)) + (compile-file 1 :output-file output-file :c-file c-file + :h-file h-file :data-file data-file + :verbose verbose :system-p system-p)) + 1 + 0) + output-file t + c-file nil + h-file nil + data-file nil + system-p nil))) + ("--compile" 1 + (progn + (setq quit + (if (nth-value 3 + (compile-file 1 :output-file output-file :c-file c-file + :h-file h-file :data-file data-file + :verbose verbose :system-p system-p)) 1 0) output-file t @@ -108,13 +133,22 @@ appeared after a '--'.") (funcall (read-from-string "c::build-program") (or output-file "lisp.exe") :lisp-files '&rest) (setq output-file t quit t))) + ("--link" &rest + (progn + (require 'cmp) + (funcall (read-from-string "c::build-program") + (or output-file "lisp.exe") :lisp-files '&rest) + (setq output-file t quit t))) ("-o" &optional (setq output-file 1)) ("-c" &optional (setq c-file 1)) ("-h" &optional (setq h-file 1)) ("-data" 1 (setq data-file 1)) + ("--data" 1 (setq data-file 1)) ("-q" 0 (setq verbose nil)) ("-hp" 0 (setf *relative-package-names* t)) + ("--hp" 0 (setf *relative-package-names* t)) ("-nohp" 0 (setf *relative-package-names* nil)) + ("--nohp" 0 (setf *relative-package-names* nil)) ("-s" 0 (setq system-p t)) ("--" 1 (setf ext:*unprocessed-ecl-command-args* (rest 1)) :stop))) -- GitLab From 2208de9f8d674476ea5b22df4d62d3910b67d161 Mon Sep 17 00:00:00 2001 From: MatthewRock Date: Sat, 17 Sep 2016 22:21:46 +0200 Subject: [PATCH 2/3] Deprecate one-dash longflags --- src/doc/ecl.man.in | 45 ++++++++++++++++++++++++++---------------- src/lsp/cmdline.lsp | 48 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 69 insertions(+), 24 deletions(-) diff --git a/src/doc/ecl.man.in b/src/doc/ecl.man.in index a2c257c8e..e13ef0053 100644 --- a/src/doc/ecl.man.in +++ b/src/doc/ecl.man.in @@ -1,4 +1,4 @@ -.TH ECL 1 2016-06-18 +.TH ECL 1 2016-09-17 .UC 4 .SH NAME ecl \- Embeddable Common Lisp @@ -7,23 +7,28 @@ ecl \- Embeddable Common Lisp \fBecl\fP [\fB-?\fP | \fB--help\fP] .br -[\fB-dir\fP \fIdir\fP] [\fB-load\fP \fIfile\fP] [\fB-shell\fP \fIfile\fP] [\fB-eval\fP \fIexpr\fP] +[\fB--dir\fP \fIdir\fP] [\fB--load\fP \fIfile\fP] [\fB--shell\fP \fIfile\fP] [\fB--eval\fP \fIexpr\fP] .br -[\fB-norc\fP] +[\fB--norc\fP] [\fB--hp\fP | \fB--nohp\fP] +.br +[\fB--debug\fP | \fB--nodevbug\fP] .br [\fB--c-stack\fP \fIsize\fP] [\fB--lisp-stack\fP \fIsize\fP] .br [\fB--heap-size\fP \fIsize\fP] [\fB--frame-stack\fP \fIsize\fP] .br -[[\fB-o\fP \fIofile\fP] [\fB-c\fP [\fIcfile\fP]] [\fB-h\fP [\fIhfile\fP]] [\fB-data\fP [\fIdatafile\fP]] +[[\fB-o\fP \fIofile\fP] [\fB-c\fP [\fIcfile\fP]] [\fB-h\fP [\fIhfile\fP]] [\fB--data\fP [\fIdatafile\fP]] .br - [\fB-s\fP] [\fB-q\fP] \fB-compile\fP \fIfile\fP] + [\fB-s\fP] [\fB-q\fP] \fB--compile\fP \fIfile\fP] .br -[[\fB-o\fP \fIofile\fP] \fB-link\fP \fIfile\fP+] +[[\fB-o\fP \fIofile\fP] \fB--link\fP \fIfile\fP+] .br [\fB--input-encoding\fP \fIexternal-format\fP] [\fB--output-encoding\fP \fIexternal-format\fP] .br [\fB--error-encoding\fP \fIexternal-format\fP] [\fB--encoding\fP \fIexternal-format\fP] +.br +\fBDEPRECATION NOTE:\fP one-dash versions of long flags(e.g. \fB-eval\fP or \fB-data\fP) are deprecated; you should use two-dash versions (e.g. \fB--eval\fP or \fB--data\fP) now. + .SH DESCRIPTION .sp @@ -55,7 +60,7 @@ A reasonable license .B \-?, \-\-help Shows the help prompt without running the ECL. .TP -.BI \-norc +.BI \-\-norc Do not load configuration files at startup. .TP .BI \-\-version @@ -65,29 +70,29 @@ Prints the current version of ECL, without running the ECL. Turned on by default, this enables the debugging in the setup phase, so that you can debug your files. .TP -.BI \-nodebug +.BI \-\-nodebug Run without debugging setup phase, meaning that errors prevent ECL from starting up. .TP -.BI \-eval " file" +.BI \-\-eval " file" Evaluate the .I file before loading the .rc file and starting the Top Level. .TP -.BI \-shell " file" +.BI \-\-shell " file" Executes the given .I file and exits, without providing a read-eval-print loop. If you want to use lisp as a scripting language, you can write -.BR "#!@bindir@/ecl -shell" +.BR "#!@bindir@/ecl --shell" on the first line of the file to be executed, and then ECL will be automatically invoked. .TP -.BI \-load " file" +.BI \-\-load " file" Load source .I file before loading the .rc file and starting the Top Level. .TP -.BI \-dir " directory" +.BI \-\-dir " directory" Use .I directory as a system directory. @@ -154,12 +159,12 @@ When compiling name the intermediary C file .I cfile and do not delete it afterwards. .TP -.BI \-data " [datafile]" +.BI \-\-data " [datafile]" Dumps compiler data into \fIdatafile\fP or, if not supplied, into a file named after the source file, but with .data as extension. .TP -.BI \-compile " file" +.BI \-\-compile " file" Translates .I file to C and invokes the local C compiler to produce a @@ -168,6 +173,12 @@ native code program. .BI \-q Short for quiet - produce less notes. .TP +.BI \-\-hp +This option is deprecated and doesn't do anything. +.TP +.BI \-\-nodp +This option is deprecated and doesn't do anything. +.TP .BI \-s Produce a linkable object file. It cannot be loaded with load, but it can be used to build libraries @@ -186,8 +197,8 @@ the ECL mailing list. .TP .BR "~/.ecl, ~/.eclrc" Default initialization files loaded at startup unless the option -.BR \-norc -is provided +.BR \-\-norc +is provided. (if they exist). .SH SEE ALSO diff --git a/src/lsp/cmdline.lsp b/src/lsp/cmdline.lsp index 0a9c5f42c..ae21725b2 100644 --- a/src/lsp/cmdline.lsp +++ b/src/lsp/cmdline.lsp @@ -23,11 +23,11 @@ (defparameter *help-message* " Usage: ecl [-? | --help] - [-dir dir] [-load file] [-shell file] [-eval expr] [-rc | -norc] [-hp | -nohp] + [--dir dir] [--load file] [--shell file] [--eval expr] [--rc | --norc] [--hp | --nohp] [--c-stack size] [--lisp-stack size] [--heap-size size] [--frame-stack size] - [[-o ofile] [-c [cfile]] [-h [hfile]] [-data [datafile]] [-s] [-q] - -compile file] - [[-o ofile] -link file+] + [[-o ofile] [-c [cfile]] [-h [hfile]] [--data [datafile]] [-s] [-q] + --compile file] + [[-o ofile] --link file+] [--input-encoding external-format] [--output-encoding external-format] [--error-encoding external-format] [--encoding external-format] [--trap-fpe | --no-trap-fpe] @@ -59,20 +59,31 @@ appeared after a '--'.") '(("--help" 0 #0=(progn (princ *help-message* *standard-output*) (quit)) :noloadrc) ("-?" 0 #0# :noloadrc) ("-norc" 0 nil :noloadrc) + ("--norc" 0 nil :noloadrc) ("--version" 0 (progn (setf quit 0) (format *standard-output* "ECL ~A~%" (lisp-implementation-version))) :noloadrc) ("-debug" 0 (setf *command-break-enable* t)) + ("--debug" 0 (setf *command-break-enable* t)) ("-nodebug" 0 (setf *command-break-enable* nil)) + ("--nodebug" 0 (setf *command-break-enable* nil)) ("-eval" 1 (eval (read-from-string 1))) + ("--eval" 1 (eval (read-from-string 1))) ("-shell" 1 (progn (setq quit 0) (setq ext:*unprocessed-ecl-command-args* (rest 1)) (load (first (rest 1)) :verbose nil)) :stop) + ("--shell" 1 (progn (setq quit 0) + (setq ext:*unprocessed-ecl-command-args* (rest 1)) + (load (first (rest 1)) :verbose nil)) + :stop) ("-load" 1 (load 1 :verbose verbose)) + ("--load" 1 (load 1 :verbose verbose)) ("-dir" 1 (setf (logical-pathname-translations "SYS") `(("**;*.*" ,(merge-pathnames "**/*.*" (truename 1)))))) + ("--dir" 1 (setf (logical-pathname-translations "SYS") + `(("**;*.*" ,(merge-pathnames "**/*.*" (truename 1)))))) ("--heap-size" 1 (ext:set-limit 'ext:heap-size (read-from-string 1))) ("--lisp-stack" 1 (ext:set-limit 'ext:lisp-stack (read-from-string 1))) ("--frame-stack" 1 (ext:set-limit 'ext:frame-stack (read-from-string 1))) @@ -92,9 +103,23 @@ appeared after a '--'.") (progn (setq quit (if (nth-value 3 - (compile-file 1 :output-file output-file :c-file c-file - :h-file h-file :data-file data-file - :verbose verbose :system-p system-p)) + (compile-file 1 :output-file output-file :c-file c-file + :h-file h-file :data-file data-file + :verbose verbose :system-p system-p)) + 1 + 0) + output-file t + c-file nil + h-file nil + data-file nil + system-p nil))) + ("--compile" 1 + (progn + (setq quit + (if (nth-value 3 + (compile-file 1 :output-file output-file :c-file c-file + :h-file h-file :data-file data-file + :verbose verbose :system-p system-p)) 1 0) output-file t @@ -108,13 +133,22 @@ appeared after a '--'.") (funcall (read-from-string "c::build-program") (or output-file "lisp.exe") :lisp-files '&rest) (setq output-file t quit t))) + ("--link" &rest + (progn + (require 'cmp) + (funcall (read-from-string "c::build-program") + (or output-file "lisp.exe") :lisp-files '&rest) + (setq output-file t quit t))) ("-o" &optional (setq output-file 1)) ("-c" &optional (setq c-file 1)) ("-h" &optional (setq h-file 1)) ("-data" 1 (setq data-file 1)) + ("--data" 1 (setq data-file 1)) ("-q" 0 (setq verbose nil)) ("-hp" 0 (setf *relative-package-names* t)) + ("--hp" 0 (setf *relative-package-names* t)) ("-nohp" 0 (setf *relative-package-names* nil)) + ("--nohp" 0 (setf *relative-package-names* nil)) ("-s" 0 (setq system-p t)) ("--" 1 (setf ext:*unprocessed-ecl-command-args* (rest 1)) :stop))) -- GitLab From c19c982090ce0aa8e71f70fedaecf0864548840d Mon Sep 17 00:00:00 2001 From: MatthewRock Date: Sat, 17 Sep 2016 23:06:57 +0200 Subject: [PATCH 3/3] Update changelog --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index de07e4747..68a1e1c89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -68,6 +68,10 @@ section "Removed interfaces". Man page now contains up-to-date list of flags, as well as explanation of flag's behavior. +- Deprecated long flags with one dash, added two-dash version +Flags that aren't one-character, but start with one dash(e.g. -eval) +are now deprecated; long version(--eval) was added instead. + - Indented C/C++ code to follow emacs's gnu C style This is a first step towards coding standards in the documentation. Additionally all in the src/c/ directory are listed in the -- GitLab