VisionSystemsInc / VisionSystemsInc/vsi_common

surprising behavior with ask_question

Open
#275 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
9
Avg merge
36m
Merged PRs (30d)
1

Description

I have noticed surprising behavior when using ask_question. If I am using the CLI version of ask_question, there are two arguments and returns 0 or 1, the question and the default answer. But if I am using the function, then there are three arguments, the question, the variable to store the answer in, and optionally, the default answer.

The problem I've run into is, if I am using the cli version of ask_question, then I supply two arguments and check the return value. However, if I source a file, and that file somewhere down the line sources ask_question, then the type/signature of ask_question changes and my default answer now becomes the variable to store the answer. This seems dangerous.

None of isin, inisin, findin or findinpaths change the signature like this

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading linux/ask_question, especially the CLI and function sections linked in the issue, and compare how isin, inisin, findin, and findinpaths behave when sourced. Trace how sourcing changes ask_question's argument handling, then define a consistent interface that does not reinterpret a CLI default answer as an output variable.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.