{"id":18073857,"url":"https://github.com/lzaoral/defloc","last_synced_at":"2026-05-09T14:17:29.816Z","repository":{"id":110023143,"uuid":"435889605","full_name":"lzaoral/defloc","owner":"lzaoral","description":"Finds locations of function definitions in shell scripts.","archived":false,"fork":false,"pushed_at":"2022-01-24T17:47:19.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T15:58:05.812Z","etag":null,"topics":["bash","shell"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lzaoral.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-07T13:23:52.000Z","updated_at":"2023-04-22T22:40:13.000Z","dependencies_parsed_at":"2023-04-16T05:04:52.247Z","dependency_job_id":null,"html_url":"https://github.com/lzaoral/defloc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzaoral%2Fdefloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzaoral%2Fdefloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzaoral%2Fdefloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzaoral%2Fdefloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzaoral","download_url":"https://codeload.github.com/lzaoral/defloc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247384612,"owners_count":20930499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","shell"],"created_at":"2024-10-31T10:09:44.617Z","updated_at":"2026-05-09T14:17:24.796Z","avatar_url":"https://github.com/lzaoral.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# defloc\n\n[![Haskell CI](https://github.com/lzaoral/defloc/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/lzaoral/defloc/actions/workflows/haskell-ci.yml)\n[![Copr build status](https://copr.fedorainfracloud.org/coprs/lzaoral/defloc/package/defloc/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/lzaoral/defloc/)\n\nSimple tool based on ShellCheck's parser that can be used to find definitions\nof functions in shell scripts.\n\n## Installation\n\n### Manual\n\nMake sure you have `cabal` installed (at least v3 recommended).\n\n1. Clone this repository.\n2. Run `cabal update`.\n3. Run `cabal install --installdir=\u003cpath\u003e`.\n4. `defloc` binary will be present in `\u003cpath\u003e` specified in the previous step.\n5. ...\n6. Profit!\n\n### Fedora\n\nYou can setup [`defloc`'s COPR repository](https://copr.fedorainfracloud.org/coprs/lzaoral/defloc/)\nusing the following commands.   Make sure you already have `dnf-plugins-core`\ninstalled.  Otherwise, `dnf` will not recognise the `copr` command.\n```console\n# dnf copr enable lzaoral/defloc\n# dnf install defloc\n```\n\n## Usage\n\n```shell\ndefloc function [scripts]\n```\n\n## Examples\n\n```console\n$ cat test.sh\n#!/usr/bin/env sh\n\nfoo() {\n    :\n}\n\nfoo() (\n    :\n)\n\nfunction foo1() {\n    :\n}\n\n$ defloc foo test.sh\ntest.sh:foo:3:1-5:2\ntest.sh:foo:7:1-9:2\ntest.sh:foo1:11:1-13:2\n\n# You can use regular expressions as well.\n$ defloc 'foo\\d' test.sh\ntest.sh:foo1:11:1-13:2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzaoral%2Fdefloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzaoral%2Fdefloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzaoral%2Fdefloc/lists"}