, bu gibi bazı komut satırı parametreleri belirtebilirsiniz:Golang: Otomatik olarak sıralama sıralama nasıl devre dışı bırakılır? <code>flag</code> paketi ile
import "flag"
fun main() {
from := flag.String("from", "", "the path to be copied")
to := flag.String("to", "", "where the data copied to")
ldb := flag.String("db", "./ldb", "the database path used during copy")
pwd := flag.String("pwd", "", "password to encrypt your data, default no encryption on your data"
flag.Parse()
...
}
yardım için kullanılması -h
, baskılı mesajı verdiğim sipariş görünüyor değil:
-db string
the database path used during copy (default "./ldb")
-from string
the path to be copied
-pwd string
password to encrypt your data, default no encryption on your data
-to string
where the data copy to
sezgisel değil sipariş , Golang'a söyleyecek başka seçenekler var: Parameterimi otomatik olarak sıralama!?