Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

命令行参数整理 #871

Closed
sorrycc opened this issue Jul 9, 2014 · 4 comments
Closed

命令行参数整理 #871

sorrycc opened this issue Jul 9, 2014 · 4 comments

Comments

@sorrycc
Copy link
Member

sorrycc commented Jul 9, 2014

-V, --version-v, --vobose

建议改成 -v, --version--vobose,原因:

  1. -v 更流行,比如 node 和 npm
  2. --vobose 通常在出状况时用于定位问题,不常用,可不加简写

另外,现在有些子命令里也带了 -V,应该去掉。

<>[]

<> 是值必选,[] 是值可选,大部分参数都应该用 <>

--no-color

有些命令有,有些命令没有,需统一处理

-q, --quite

感觉意义不大,建议删除。

比如 spm info type -q 仅输出了 sorryccspm install type -q 无任何输出。

参数描述

  1. 应统一首字母不大写,结尾不加 .。不统一的比如:

    -h, --help     output usage information
    -v, --verbose  Show more infomation.
    
  2. 同一个参数在不同命令下的描述应一致,比如:

    -s, --source [name]  the source repo name
    -s, --source [name]  source name in spmrc
    -s, --source [name]  default value will be the first source
    

spm install

  1. spm install pkg -g 目前没有用, package 解析的时候不会读 .spm/sea-modules
  2. 建议默认 --save,node_modules 不 save 可以用,我们目前解析 pkg 的时候以 package.json 里的为准,不 save 用不起来
  3. -b, --base 改成 -I, --input-directory-d, --destination 改成 -O, --output-directory,和 spm build 保持一致

spm publish

  1. help command 多余了,可以去掉
@sorrycc sorrycc added the discuss label Jul 9, 2014
@sorrycc
Copy link
Member Author

sorrycc commented Jul 9, 2014

#866

@afc163
Copy link
Member

afc163 commented Jul 9, 2014

quite 在 API 调用时有用。
install -g 这个,应该修复 package 解析的时候不会读 .spm/sea-modules 的问题吧。

其他都同意。

@sorrycc
Copy link
Member Author

sorrycc commented Jul 9, 2014

@popomore 讨论了下,实现全局 sea-modules 有不少要考虑的情况,调整有点大,优先级相对较低。我觉得这里的参数可以先去掉,等之后实现了再加上。

@afc163
Copy link
Member

afc163 commented Jul 9, 2014

--save 还是不要默认加上吧,spm install 可能用在没有 package.json 的地方。

@popomore popomore mentioned this issue Jul 14, 2014
18 tasks
@sorrycc sorrycc closed this as completed Jul 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants