【发布时间】:2015-02-20 19:16:30
【问题描述】:
我在一个我正在处理的模块的示例中使用docopt,并且所有选项默认值都有效,除了一个。我已经修改了包含和围绕该选项的所有代码,试图识别问题,但它不会采用默认值!
我的选项块如下所示:
Options:
--help Show this message and exit
--version Show version info and exit
-w WIDTH --width=WIDTH The out to out width of the deck (feet) [default: 73]
-g GIRDERS --girders=GIRDERS The number of girders [default: 8]
-h HEIGHT --height=HEIGHT The height of the girders (inches) [default: 56]
-t THICK --thick=THICK The deck thickness (inches) [default: 8]
-a ADIM --adim=ADIM The "A" dimension, max deck thick @ CL girder [default: 12]
-l LSLP --leftslope=LSLP The left-hand deck slope (ft/ft) [default: -0.02]
-r RSLP --rightslope=RSLP The right-hand deck slope (ft/ft) [default: -0.02]
-c --center Indicates pivot point is at center of bridge
-o OFFSET --offset=OFFSET The offset of pivot point from center [default: 0]
girders 选项永远没有默认值!
我重读了几次this question,但似乎无关。
【问题讨论】:
-
我的猜测:每个选项描述之前必须至少有 2 个空格
-
我的猜测也是 - 我遇到了同样的问题,请参阅stackoverflow.com/questions/13995352/…