EntryPoint
1.3.0 - Make getters for BaseOptionAttribute public
Composable CLI อาร์กิวเมนต์ตัวแยกวิเคราะห์สำหรับแพลตฟอร์ม. NET ที่ทันสมัยทั้งหมด
การแยกวิเคราะห์อาร์กิวเมนต์ในรูปแบบ UtilityName [command] [-o | --options] [operands]
สนับสนุน:
ตามมาตรฐาน IEEE อย่างใกล้ชิด แต่รวมถึง adblibs ทั่วไปเช่นตัวเลือกสไตล์ --option เต็มรูปแบบ
entrypoint มีอยู่ใน NuGet:
PM> Install-Package EntryPoint
ยินดีต้อนรับการร้องขอและข้อเสนอแนะและงานเล็ก ๆ บางอย่างอยู่ในประเด็น
เอกสารฉบับเต็ม: https://nick-lucas.github.io/entrypoint/
ตัวอย่างการใช้งาน: https://github.com/nick-lucas/entrypoint/tree/master/test/example
แยกวิเคราะห์ข้อโต้แย้งบรรทัดคำสั่งของแอปพลิเคชันของคุณลงในโพโกที่ประกาศในบรรทัดเดียว
อาร์กิวเมนต์ถูกกำหนดให้เป็น poco ที่ประกาศโดยใช้แอตทริบิวต์
var arguments = Cli . Parse < CliArguments > ( args ) ;
if ( arguments . Option ) {
// ...
} ; public class CliArguments : BaseCliArguments {
public CliArguments ( ) : base ( "MyApplication" ) { }
[ Option ( ShortName : 'o' ,
LongName : "option-1" ) ]
public bool Option { get ; set ; }
}คำสั่งมี API เฉพาะ:
Cli . Execute < CliCommands > ( args ) ; public class CliCommands : BaseCliCommands {
[ Command ( "primary" ) ]
public void Primary ( string [ ] args ) {
// Arguments Parsing and Command Code...
}
}