Giter Club home page Giter Club logo

Comments (5)

NevermindZZT avatar NevermindZZT commented on June 29, 2024

之前那种传参方法和现在的传参方式,没有想到好的方法共存,如果需要之前那种,将SHELL_AUTO_PRASE宏改成0就行

from letter-shell.

mojinpan avatar mojinpan commented on June 29, 2024

是不是可以考虑增加一个控制字来处理的这些配置需求?
当前的自动参数转换,完全是按照输入来处理,没有考虑到输入合法性校验,也许后面是需要考虑类似的需求的,提供控制字来配置这些,可能会比较好的处理这些问题

from letter-shell.

NevermindZZT avatar NevermindZZT commented on June 29, 2024

输入合法性这个,想不出怎么控制,PC上面的shell也没有对输入合法性做处理的,不过pc是用argc这种方式传参,也是这个shell之前的方式,放在嵌入式用体验不是太好,现在这种方式,参数出问题确实可能造成程序跑飞

from letter-shell.

mojinpan avatar mojinpan commented on June 29, 2024

那我就把自动参数转化做一个封装,作为一个单独的模块,给程序来调用,程序拿到传参后,把参数丢给这个模块,一方面实现参数校验,另外一方面实现参数转换。这个模块就作为shell的一个附加模块来使用。

from letter-shell.

NevermindZZT avatar NevermindZZT commented on June 29, 2024

参数检验的难点在于shell无法知道被调用的函数需要的参数类型,参数数量,所以只能根据输入做估计

from letter-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.