{ "info": { "author": "Kevin Marilleau", "author_email": "kevin.marilleau@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Plugins", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: System :: Shells", "Topic :: System :: System Shells" ], "description": "xontrib-rerun\n===============================\n\nversion number: 0.1.01\nauthor: Kevin Marilleau\n\nOverview\n--------\n\nRerun previous commands\n\nInstallation\n------------\n\nTo install use pip:\n\n $ xpip install xontrib-xontrib-rerun\n\n\nOr clone the repo:\n\n | $ git clone https://github.com/kmarilleau/xontrib-rerun.git\n | $ xpip install ./xontrib-rerun\n\nUsage\n-----\n\n | $ rerun [--edit ] [--startswith ] [--contain ]...\n | $ [--replace ]... [--confirm]\n | $ rerun LEN [OFFSET] [options] [-C ]... [-R ]... [-c | --confirm-each]\n | $ rerun (-h | --help)\n | $ rerun rerun [] [--confirm | --confirm-each]\n | $ rerun rerun list\n | $ rerun (-h | --help)\n\nCommands\n--------\n | $ list View current history.\n | $ ls Alias for ``list``.\n | $ rerun Re-execute commands that have already been executed.\n\nArguments\n---------\n | $ LEN Number of commands to re-execute.\n | $ OFFSET Re-execute commands before n last commands.\n | $ INDEX Index of commands in ``rerun rerun list``.\n\nOptions\n-------\n | $ -h, --help Do we really need to explain?\n | $ -c, --confirm View commands and confirm their execution.\n | $ --confirm-each Confirm the execution of each command.\n | $ -e, --edit Edit commands.\n | $ -C, --contain Rerun from last command containing .\n | $ -S, --startswith Rerun from last command starting with .\n | $ -R, --replace Replace all substring in selected commands.\n | $ --eq Rerun only if len of selected commands == LEN.\n\n\nDescription\n-----------\n\n Let's assume that our history looks like this:\n >>> git init myproject && cd myproject\n >>> touch Dockerfile \\\\\n ... && echo 'FROM nginx' >> Dockerfile \\\\\n ... && echo 'WORKDIR /usr/share/nginx/html/' >> Dockerfile \\\\\n ... && echo 'RUN echo \"

Foo

\" > index.html' >> Dockerfile\n >>> docker build . -t last_build\n >>> docker run --rm -it -p 8080:80 last_build\n We created a Dockerfile, we built a docker image with it. Then we runned a \n container that uses this image.\n \n | Note:\n | All these commands work, you can launch them on your shell and then see \n | the result from your browser at http://localhost:8080.\n \n If we decide to stop the container with Ctrl+C and recreate the same container, \n many shells offer to find and re-execute the last command by press 'Up Arrow' \n then 'Enter'. Otherwise, you can do the same thing by simply typing:\n >>> rerun\n We stop our container with Ctrl+C, we run the commands below to check that \n our container is no longer running:\n >>> docker ps\n Let's add the Dockerfile to our project and then make our first commit:\n >>> git add Dockerfile\n >>> git commit -am \"create Dockerfile\"\n Now let's suppose that we need to modify the Dockerfile:\n >>> echo 'RUN echo \"

Bar

\" >> index.html' >> Dockerfile\n \n If we run ``rerun list`` or ``rerun ls``, We can see our history look like this:\n 10: rerun ls\n 09: git init myproject && cd myproject\n 08: touch Dockerfile \\\\\n && echo 'FROM nginx' >> Dockerfile \\\\\n && echo 'WORKDIR /usr/share/nginx/html/' >> Dockerfile \\\\\n && echo 'RUN echo \"

Foo

\" > index.html' >> Dockerfile\n 07: docker build . -t last_build\n 06: docker run --rm -it -p 8080:80 last_build\n 05: rerun\n 04: docker ps\n 03: git add Dockerfile\n 02: git commit -am \"create Dockerfile\"\n 01: echo 'RUN echo \"

Bar

\" >> index.html' >> Dockerfile\n \n To see the result in our browser, we need to re-execute commands below:\n >>> docker build . -t last_build\n >>> docker run --rm -it -p 8080:80 last_build \n \n To do this, we just have to run:\n >>> rerun 2 5\n It means:\n \"Restarts the two commands before the last five commands that have been \n executed.\"\n If we want to see selected commands before and confirm their execution, we only \n need to add '--confirm' option:\n >>> rerun 2 5 --confirm\n If we want to see and confirm execution of each command, we can do this:\n >>> rerun 2 5 --confirm-each\n Let's update our Dockerfile in our git branch, make another commit, then view \n and confirm results commands:\n >>> rerun 2 -S 'git add' --replace create=update -c\n It means:\n \"Restart the two commands from the first latest command starting with \n 'git add', replace all 'create' substrings by 'update' then show me the \n result and let me confirm execution\"\n The commands to be executed should now look like this:\n >>> git add Dockerfile\n >>> git commit -am \"update Dockerfile\"\n \n If instead we wanted to change the name of the Dockerfile by Mydockerfile, make \n a commit, then view and confirm commands, do:\n >>> rerun 2 -c -S 'git add' \\\\\n ... -R create=rename \\\\\n ... -R 'add Dockerfile'='mv Dockerfile Mydockerfile'\n \n | Note:\n | You can use single/double quotes and even none with ``--replace`` \n | arguments. Just remember to escape quotes from your sub-chains.\n | See examples below:\n | \n | >>> rerun --replace old=\"new\"\n | >>> rerun --replace \"For what it's worth\"='Buffalo Springfield'\n | >>> rerun --replace TVSeries='That\\\\'s 70 Show'\n \n As you can see, you can replace as many substrings as you want. \n But, you can quickly find it tiring to make all these changes with the command \n line. You can use an editor with --edit instead of --replace:\n \n To use it, simply add the option --edit (or -e):\n >>> rerun 2 -c -S 'git add' --edit\n Modify your text and quit the editor. \n \n | Warning:\n | All comments are deleted when you exit the text editor.\n \n If you have not specified one, rerun use $RERUN_EDITOR as default editor. And \n $RERUN_EDITOR points directly to $EDITOR if you have not assigned a value to it.\n For example, if you want to use nano as default editor for rerun, add \n ``$RERUN_EDITOR = nano`` to your .xonshrc.\n Now let's imagine that we need to re-execute commands that have already been \n re-executed. Let's start by listing the commands:\n >>> rerun rerun list\n 4: docker run --rm -it -p 8080:80 last_build\n 3: docker build . -t last_build\n docker run --rm -it -p 8080:80 last_build\n 2: git add Dockerfile\n git commit -am \"update Dockerfile\"\n 1: git mv Dockerfile Mydockerfile\n git commit -am \"rename Dockerfile\"\n \n If you need to re-execute the last re-executed commands, just run:\n >>> rerun rerun\n Else, just specified index of commands:\n >>> rerun rerun 3\n Like the rerun command, you can use modifiers and confirm arguments like \n ``--replace``, ``--edit``, ``--confirm`` or ``--confirm-each``:\n >>> rerun rerun 3 -e nano -c\n\nCredits\n---------\n\nThis package was created with cookiecutter_ and the xontrib_ template.\n\n.. _cookiecutter: https://github.com/audreyr/cookiecutter\n.. _xontrib: https://github.com/laerus/cookiecutter-xontrib", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kmarilleau/xontrib-rerun", "keywords": "", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "xontrib-rerun", "package_url": "https://pypi.org/project/xontrib-rerun/", "platform": "any", "project_url": "https://pypi.org/project/xontrib-rerun/", "project_urls": { "Homepage": "https://github.com/kmarilleau/xontrib-rerun" }, "release_url": "https://pypi.org/project/xontrib-rerun/0.11/", "requires_dist": null, "requires_python": "", "summary": "Rerun previous commands", "version": "0.11" }, "last_serial": 4563928, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d4b79d0462d12d5dbf4ee7493bbce41d", "sha256": "02dc8cc2145ac7272920e70cd3e59b4d6ca719a9733da48b2480fb381a88bda4" }, "downloads": -1, "filename": "xontrib-rerun-0.1.tar.gz", "has_sig": false, "md5_digest": "d4b79d0462d12d5dbf4ee7493bbce41d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11001, "upload_time": "2018-12-04T13:19:52", "url": "https://files.pythonhosted.org/packages/33/d5/7c33e18cf2f27bdb0951ea504c1804fdf4c0c2e6828923d2d4109bc36577/xontrib-rerun-0.1.tar.gz" } ], "0.10": [ { "comment_text": "", "digests": { "md5": "ed639914d549f2495424c9130560f84b", "sha256": "3731f6230bd49648197a69370935f718fed9b4d0400b15e16a06ebc3b3ae9c83" }, "downloads": -1, "filename": "xontrib-rerun-0.10.tar.gz", "has_sig": false, "md5_digest": "ed639914d549f2495424c9130560f84b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11573, "upload_time": "2018-12-04T14:18:21", "url": "https://files.pythonhosted.org/packages/51/02/a64f06e86b52a40a48db022cb59d821cf287478a1412085f9386bf831f82/xontrib-rerun-0.10.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "ed5e442b4b8a73d0c6eb92c745b582c2", "sha256": "334f11a8051444f6aaea06372e083b0fe17c8ff876db4e8a95c7eac78458f1bd" }, "downloads": -1, "filename": "xontrib-rerun-0.11.tar.gz", "has_sig": false, "md5_digest": "ed5e442b4b8a73d0c6eb92c745b582c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12275, "upload_time": "2018-12-05T14:02:50", "url": "https://files.pythonhosted.org/packages/17/03/af56308f1b3b9cadca8083136e2ef7ff05936ec2ec033891545a6a01e1d9/xontrib-rerun-0.11.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a460ace2994024da81868892ce5b6c1a", "sha256": "64b3dc8919be3f606e20b6c29b462fe3ccda415c1d2f8607a0f45d0b5eea1281" }, "downloads": -1, "filename": "xontrib-rerun-0.2.tar.gz", "has_sig": false, "md5_digest": "a460ace2994024da81868892ce5b6c1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10980, "upload_time": "2018-12-04T13:49:24", "url": "https://files.pythonhosted.org/packages/72/8b/40e6cea75cbf36f144f8961a500d5c48f1ab77b3d8ddf78b223f7497b42e/xontrib-rerun-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a27dec8ad806190719f42a49d46f3779", "sha256": "a53cb50d08908e2363cd265b7cbc6fcb68ef16d67e1866db53c8b4deceda0add" }, "downloads": -1, "filename": "xontrib-rerun-0.3.tar.gz", "has_sig": false, "md5_digest": "a27dec8ad806190719f42a49d46f3779", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11559, "upload_time": "2018-12-04T13:55:25", "url": "https://files.pythonhosted.org/packages/77/c7/784715030199d3007efc6ed620d4a50eee2f4d753e1f7929203aae3f706b/xontrib-rerun-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f2eee0ebb958612571092aa73aa07f45", "sha256": "6ae528a9985cbfdbe98e6f265551d0ad41acc378ad23fb41cb62f3c25af882de" }, "downloads": -1, "filename": "xontrib-rerun-0.4.tar.gz", "has_sig": false, "md5_digest": "f2eee0ebb958612571092aa73aa07f45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11569, "upload_time": "2018-12-04T13:58:11", "url": "https://files.pythonhosted.org/packages/d5/ee/a88f2855b8c9add4fc89521a2ada77195ab755297ea883d1b87cff187604/xontrib-rerun-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "671f33e24cf91c080c9f10d986fbbcca", "sha256": "af932c711254052a5f1f3c59f41a3c5525737f1c7f35b0858e539e7c11ff9eb9" }, "downloads": -1, "filename": "xontrib-rerun-0.5.tar.gz", "has_sig": false, "md5_digest": "671f33e24cf91c080c9f10d986fbbcca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11579, "upload_time": "2018-12-04T14:02:39", "url": "https://files.pythonhosted.org/packages/49/17/10e1c3db26fc43ea6ffaf0d6785b288652c94967094a32c29df6b42c868c/xontrib-rerun-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "1d6a6f7d2f2b2ae724675aa9ce94e4a9", "sha256": "7751dbd46d09b1333efc8147d0a72f313c7d1b9ddacd781b49279d3ec83936ac" }, "downloads": -1, "filename": "xontrib-rerun-0.6.tar.gz", "has_sig": false, "md5_digest": "1d6a6f7d2f2b2ae724675aa9ce94e4a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11576, "upload_time": "2018-12-04T14:06:50", "url": "https://files.pythonhosted.org/packages/c0/a6/52c2b83694ba84ef814d69693cc16dbd65f4bfd49a0073ad5734f889a112/xontrib-rerun-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "2a165d099196a193e5fe8cce34ec4950", "sha256": "6cb1f8538ed169be4a4048963bdec33fc7d2ce20eb5a66ad9aa737acf6b39f8e" }, "downloads": -1, "filename": "xontrib-rerun-0.7.tar.gz", "has_sig": false, "md5_digest": "2a165d099196a193e5fe8cce34ec4950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11575, "upload_time": "2018-12-04T14:09:59", "url": "https://files.pythonhosted.org/packages/0a/53/649a09ae16e05c63b46f8529370284b52d11d8e0aaa69c532c1b3ac6b557/xontrib-rerun-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "ad684c03a8a9728e55dd0737e0a86386", "sha256": "38ca17637f497b6a3a9cd60f5736c19566f25832d6968d05ff9e3e8a73cab6cc" }, "downloads": -1, "filename": "xontrib-rerun-0.8.tar.gz", "has_sig": false, "md5_digest": "ad684c03a8a9728e55dd0737e0a86386", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11581, "upload_time": "2018-12-04T14:12:00", "url": "https://files.pythonhosted.org/packages/c8/ca/2b7d74f6d79b21db7f015593db2fbe2b04095a9981fee8671e73015ea908/xontrib-rerun-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "3968b073096f603ea9a5457bfc8088b1", "sha256": "f7e11ebac0261f18e3175358f917e70f8558941e5d0d21e876cdaa5feda66a56" }, "downloads": -1, "filename": "xontrib-rerun-0.9.tar.gz", "has_sig": false, "md5_digest": "3968b073096f603ea9a5457bfc8088b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11576, "upload_time": "2018-12-04T14:14:32", "url": "https://files.pythonhosted.org/packages/7b/64/0008def687b496142fcdac86c325e3ed2b5c735f13199bde615bf3cc0a7c/xontrib-rerun-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed5e442b4b8a73d0c6eb92c745b582c2", "sha256": "334f11a8051444f6aaea06372e083b0fe17c8ff876db4e8a95c7eac78458f1bd" }, "downloads": -1, "filename": "xontrib-rerun-0.11.tar.gz", "has_sig": false, "md5_digest": "ed5e442b4b8a73d0c6eb92c745b582c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12275, "upload_time": "2018-12-05T14:02:50", "url": "https://files.pythonhosted.org/packages/17/03/af56308f1b3b9cadca8083136e2ef7ff05936ec2ec033891545a6a01e1d9/xontrib-rerun-0.11.tar.gz" } ] }