diff --git a/samples/hello.ros b/samples/hello.ros index 526ac08..d191e75 100755 --- a/samples/hello.ros +++ b/samples/hello.ros @@ -1,5 +1,8 @@ -#!/usr/bin/env ros - +#!/bin/sh +#|-*- mode: lisp -*-|# +#|Docstring like 1 line comment that are accepted if it installed +exec ros -- $0 "$@" +|# (defun main (&rest argv) (format t "Hello World!~%") (format t "argv=~S~%" argv)) diff --git a/src/cmds/help/cmd.c b/src/cmds/help/cmd.c index f52df0d..170d0b3 100644 --- a/src/cmds/help/cmd.c +++ b/src/cmds/help/cmd.c @@ -99,25 +99,20 @@ int cmd_help(int argc, const char **argv) char* fname=cat(subcmds,SLASH,f,NULL); if((in=fopen(fname,"rb"))!=NULL) { int i=0,c; - while((c=fgetc(in))!=EOF) { - if(c=='\n') + for(;i<2;++i) + while((c=fgetc(in))!=EOF && c!='\n'); + i=0; + for(;(c=fgetc(in))!=EOF;buf[i++]=c) + if(c=='\r'||c=='\n'||i==799) break; - } - while((c=fgetc(in))!=EOF) { - if(c=='\r'||c=='\n'||i==799) { - break; - } - buf[i++]=c; - } buf[i]='\0'; fclose(in); - }else{ - strcpy(buf,""); - } + }else + buf[0]='\0'; s(fname); f[len]='\0'; - buf[strlen(buf)-1]='\0'; - fprintf(stderr,fmt,f,buf+1); + if(buf[0]='#' && buf[1]=='|') + fprintf(stderr,fmt,f,buf+2); } } } diff --git a/src/lisp/delete.ros b/src/lisp/delete.ros index e10e10c..30385b3 100644 --- a/src/lisp/delete.ros +++ b/src/lisp/delete.ros @@ -1,5 +1,8 @@ -#!/bin/env ros -"Delete installed implementations." +#!/bin/sh +#|-*- mode:lisp -*-|# +#|Delete installed implementations +exec ros -- $0 "$@" +|# (defpackage :ros.delete (:use :cl)) @@ -38,5 +41,3 @@ ((or (equal subcmd "help") (not r)) (format t "Usage: ~A [OPTIONS] ~A impl/version ~%" (second (assoc "argv0" *opts* :test 'equal)) cmd)))) - - diff --git a/src/lisp/dump.ros b/src/lisp/dump.ros index 64a23f6..5f25a68 100644 --- a/src/lisp/dump.ros +++ b/src/lisp/dump.ros @@ -1,5 +1,8 @@ -#!/bin/env ros -"Dump image for faster startup or Make Executable" +#!/bin/sh +#|-*- mode:lisp -*-|# +#|Dump image for faster startup or Make Executable +exec ros -- $0 "$@" +|# (defpackage :ros.dump (:use :cl)) diff --git a/src/lisp/install.ros b/src/lisp/install.ros index dbfa3c3..977d5ff 100644 --- a/src/lisp/install.ros +++ b/src/lisp/install.ros @@ -1,4 +1,9 @@ -#!/usr/bin/env ros +#!/bin/sh +#|-*- mode:lisp -*-|# +#|install roswell +exec ros -- $0 "$@" +|# + (cl:in-package :cl-user) (require :asdf) diff --git a/src/lisp/list.ros b/src/lisp/list.ros index 86a8425..2330520 100644 --- a/src/lisp/list.ros +++ b/src/lisp/list.ros @@ -1,5 +1,8 @@ -#!/bin/env ros -"List Information" +#!/bin/sh +#|-*- mode:lisp -*-|# +#|List Information +exec ros -- $0 "$@" +|# (defpackage :ros.list (:use :cl))