gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
Improve the clarity of the following request [code] Name: <value> Title: <value>…
- User
Improve the clarity of the following request
codeCode a monolithic JavaScript CLI application that works as follows: Basically, this application is used to add, modify, delete, and search on a dataset provided by the user. The user can provide the path to the dataset with the `--edit` flag. This would launch an interactive prompt asking for the path. The path is saved to `config.json` which is in the same directory as this application. The user can view the path to the dataset with the `--config` flag. The dataset should contain data units in this format ``` Name: <value> Title: <value> Description: <value> ``` The format includes key-value pairs. For the user to add data units to the dataset, it must use the `--add` flag, which would launch interactive prompts asking for values for the name title, and description keys. providing values for these keys should not be one at a time. in other words, it should not ask first for the value of the name before the other elses. To modify a specific data unit, the `--modify` flag is used with a parameter given by the user. The parameter for this flag is always the value of the `Name` key. The user provides the value of a specific name in the dataset as the parameter, and then interactive prompts will show up showing the name key itself and its associated title and description keys with their values. The user will able to edit the values of the name, title, and description in the same way as inputting values with the `add` flag. To delete a specific data unit, the `--delete` flag is used with a parameter. The parameter is also always the value of the name of the specific data unit. This deletes the name, title, and description key-value pairs which make up the data unit. The user can delete multiple data units by providing their names separated by a space. The value of name key is always a string, so it won't contain any whitespace. To search on the dataset for a specific data unit, the `--find` flag is used with a parameter, which is also always the value of the name of the data unit. It is because the name key-value pair identifies a data unit from other data units in the dataset. It basically acts like an ID for a data unit. Once the argument is passed, the name, title, and description key-value pairs of that data unit will be immediately printed. The user can also search multiple data units simultaneously. That can be done by providing the name values of data units as the parameter of the `--find` flag separated by a space. One the argument is passed, the data units will be immediately printed, each data unit is separated by a newline. Include a comprehensive help menu accessible via '-h' or '--help', detailing all available commands and their usage. Additionally, implement robust error handling with clear user feedback. Moreover, make a short flag, in addition to the long flags, for each flag available in this application. Lastly, use CommonJs, and make a nice name for this application. - Assistant