我希望我的CLI应用程序的用户输入他们想要保存文件的特定路径。我试着使用Cobra的——config标志,但是我不知道怎么做。
的例子:
app --config path "~/Documents/"
我怎么能这么做?
您可以尝试指定一个绝对路径。
app --config path "$HOME/Documents/"