Giter VIP home page Giter VIP logo

command-not-found's Introduction

Command-not-found for termux

This repo contains sources for the command-not-found utility used in termux. Apart from the sources for the binary (command-not-found.cpp), it also contains a script to generate lists of commands for the various official repositories:

Building command-not-found

To build the package, cmake and a c++ compiler (for example g++ or clang++) needs to be installed. Apart from cmake and a C++ compiler, nodejs is also needed in order to generate list of commands. To do an out of source build, run these commands from the command-not-found directory:

mkdir build && cd build
cmake ..
make

This will generate command lists by running ./generate-db.js, and create a command-not-found binary which can be tested directly. To then install the program, run:

make install

This installs command-not-found to CMAKE_INSTALL_PREFIX/libexec/termux, which is where command-not-found resides in termux.

Updating the command lists

In order to update the command lists, just a rebuild of command-not-found is to be done by bumping the TERMUX_PKG_REVISION in build recipe of command-not-found.

command-not-found's People

Contributors

grimler91 avatar jidhub avatar landfillbaby avatar maxython avatar ravener avatar thunder-coding avatar xtkoba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

command-not-found's Issues

Enable auto-update

Currently, when we want to update the database of command-not-found, we need to bump revision in build.sh. Of course, if our updates are timely enough, this won't be a problem. But in many cases, it is not very easy to update timely. Following are three methods I thought of for this problem.

  1. Implement automatic update by setting TERMUX_PKG_AUTO_UPDATE=true and customizing the termux_pkg_auto_update function. In fact, there is no need to check for version updates in termux_pkg_auto_update, just replacing TERMUX_PKG_REVISION with sed command is enough, I suppose.
  2. Use Github Action and cron to automatically publish a Release/Tag, without making any changes to the source code, just increase the version number in the release/tag to "trick" our auto-update bot.
  3. Use Github Action and cron to automatically generate database header files, and then publish a Release. When Action runs, it will use generate-db.js to generate header files, and then package headers, source codes and other files into a zip, and publish this zip to Github Release. build.sh is only responsible for compiling, not for generating headers.

Of the three methods listed above, I don't quite agree with the first one. Our auto-update bot runs every six hours, which is so frequent for updating command-not-found. I don't think it is needed. I think the appropriate interval between two updates should be half a month. For the second and third methods, I think both are OK, and I have no idea which one is better.

If you have any other suggestion, please feel free to post it, thanks.

Periods seem to be treated as placeholder characters?

Sorry if this is mentioned somewhere, but I failed to find anything about this, and my C++ knowledge is nil.

Try running .. for instance (it will show all commands with two characters or less). It works with ... too, but trying four periods and longer seems to not show the "did you mean" thing for some reason. This also works with other characters (e.g. try running p.thon); it reminds me of regexes.

Is this intended behavior? If so, it would be great if it was documented, I can imagine it being useful.

update-command-not-found?

update-command-not-found is a utility for command-not-found to update the repositories that one has installed and synchronize them, apparently that command does not exist, has not been added or is not intended to be added?

Why is ping in termux-tools?

~ $ png
No command png found, did you mean:
 Command ping in package termux-tools
~ $

I think he should be in some other package than termux-tools.

makensis

~ $ makensis
No command makensis found, did you mean:
Command makealias in package hunspell

https://github.com/termux/termux-packages/blob/master/packages/nsis/build.sh

~ $ pkg i nsis Hit:1 https://mirrors.ustc.edu.cn/termux/apt/termux-main stable InRelease Hit:2 https://mirrors.ustc.edu.cn/termux/apt/termux-games games InRelease Hit:3 https://mirrors.ustc.edu.cn/termux/apt/termux-science science InRelease Hit:4 https://mirrors.ustc.edu.cn/termux/apt/termux-x11 x11 InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree... Done Reading state information... Done nsis is already the newest version (3.08). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

~ $ cd $PREFIX/opt/nsis .../opt/nsis $ ls makensis

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.