command-line-interface

Python arguments passed with quotes

和自甴很熟 提交于 2020-05-28 03:36:20
问题 I'm trying to pass file list to my python script via argument: python script.py -o aaa -s bbb "filename.txt" "filename2.txt" "file name3.txt" Unfortunately ArgumentParser is ignoring quotes and instead of giving list of 3 files it gives me list of 4 elements as followed: 1) "filename.txt" 2) "filename2.txt" 3) "file 4) name3.txt" It completely ignores quotes. How to make it work with quotes? 回答1: Hard without seeing what you're using or any code. Your shell may be interfering, you may need to

.Net Core dotnet run is not running the last modified source code

别来无恙 提交于 2020-05-17 06:57:48
问题 I am working on Asp.Net Mvc project with .Net Core 2.2. I can not run the last modified source code from command line/powershell. I tried manually calling dotnet clean and dotnet build before dotnet run but did not work. I can only run the last modified source code with cli if I run/debug my project within Visual Studio 2019 before. How can i solve this problem? I am using Windows 10. I have both SDK versions 3.1 and 2.2 installed but I declare the version by <PropertyGroup> <TargetFramework

Upgrade angular CLI to 8

孤者浪人 提交于 2020-05-16 10:31:13
问题 I have encountered the following errors when updating the version of Angular Cli to 8 . Could not find module "@angular-devkit/build-angular" from "C:\\Users\\AGT\\Desktop\\central8\\client". Error: Could not find module "@angular-devkit/build-angular" from "C:\\Users\\AGT\\Desktop\\central8\\client". at Object.resolve (C:\Users\AGT\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\node\resolve.js:151:11) at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:

PHP CLI - Ask for User Input or Perform Action after a Period of Time

混江龙づ霸主 提交于 2020-05-13 05:09:26
问题 I am trying to create a PHP script, where I ask the user to select an option: Basically something like: echo "Type number of your choice below:"; echo " 1. Perform Action 1"; echo " 2. Perform Action 2"; echo " 3. Perform Action 3 (Default)"; $menuchoice = read_stdin(); if ( $menuchoice == 1) { echo "You picked 1"; } elseif ( $menuchoice == 2) { echo "You picked 2"; } elseif ( $menuchoice == 3) { echo "You picked 3"; } This works nicely as one can perform certain actions based on user input.

Angular CLI Error path and code EEXIST

微笑、不失礼 提交于 2020-05-13 03:55:46
问题 I first installed npm and made sure it was up to date. Then I tried installing angular but I was faced with errors ~ kode$ sudo npm install -g @angular/cli Password: npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm ERR! path /usr/local/bin/ng npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin npm ERR!

Angular CLI Error path and code EEXIST

守給你的承諾、 提交于 2020-05-13 03:55:38
问题 I first installed npm and made sure it was up to date. Then I tried installing angular but I was faced with errors ~ kode$ sudo npm install -g @angular/cli Password: npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm ERR! path /usr/local/bin/ng npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin npm ERR!

How do I install .NET Core in the Azure CLI shared folder?

╄→гoц情女王★ 提交于 2020-04-30 06:29:11
问题 I need to update the .NET Core version for use with Azure Functions. The dotnet command shows that the highest version available is 2.2.402. Checking in the Azure Portal CLI, the .NET Core files are installed in usr/share/dotnet/sdk . I can install .NET Core v3.1.0.2 on my Windows 10 PC, but I can't see how to install into the share/dotnet/sdk folder so that the global.json can reference this version of .NET Core. After installing .NET Core on Windows 10 on the c:\ drive: PS /home/username>

looping through a list of archive id with cli aws describe-job returns null on output

雨燕双飞 提交于 2020-04-17 22:09:26
问题 I have a loop that gets all the ids and checks for the status of the jobs on cli. jq -r '.JobList |= unique_by(.ArchiveId) | .JobList[] | "\(.JobId)"' jobs.json\ | while IFS= read -r job_id; do job_status=$(aws glacier describe-job --account-id 2222222--vault-name my-vault --job-id $job_id --output json) echo $job_status"," >> job-status.json done My issue here is that I get the following response everytime it goes past the job_status command usage: aws [options] <command> <subcommand> [

How to activate only options when we use click.group()

[亡魂溺海] 提交于 2020-04-16 02:57:48
问题 I'm currently working to create Command line arguments with click. I almost done the research, and everything is working fine. The issue is I want to use the only option while working with the click.group() other than sub commands. Lets say myCommand --version this should print my application's version but it's raising error saying Error: Missing command. My code is: import sys import os as _os import click import logging from myApp import __version__ @click.group() @click.option('--version',

How do I handle character encoding for stdout stream of (cli) output in/from node.js?

☆樱花仙子☆ 提交于 2020-04-13 17:36:52
问题 I am confused about how to safely store and read the process.stdout output in Node.js: Is the CLI output of console.log() (and such) done in a specific character encoding? Or is it raw binary of unspecified form? Can there be binary data? (I have no idea) Node.js is very utf8 oriented, but then JS is UCS2 and I have no idea what the stream does with it. And related: is it safe to apply a string-diff to the stream if I convert the Buffer to String in utf8 (the default)? Note my diff renderer